Subscription#106
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
==========================================
+ Coverage 49.27% 50.91% +1.64%
==========================================
Files 13 14 +1
Lines 621 707 +86
==========================================
+ Hits 306 360 +54
- Misses 315 347 +32 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Possibly related to this, I'm not able to run any subscriptions. Is there a way to get it working with the current state or does the auth stuff need fixing first? |
|
The way I'm testing it is by chaning these lines in the tiled server code to just return "secret" I tried to get the headers today but could'nt find a way |
691e822 to
4bb20a3
Compare
tpoliaw
left a comment
There was a problem hiding this comment.
The public_address problem and the error reporting are the main changes needed - most of the other comments aren't critical
|
@tpoliaw I have fixed the public address issue and the errors are also reported now. Think to note : tiled has a new way of doing auth for websocket To test if errors are coming try adding the apikey header with a wrong value For unit tests:- |
tpoliaw
left a comment
There was a problem hiding this comment.
The graphiql editor is also failing to get the schema with a CORS error - no idea why
| .expect("Timeout waiting for headers") | ||
| .expect("Channel closed"); |
There was a problem hiding this comment.
nit: expect messages are usually the condition you expect to be met rather than the error state, so something like .expect("Headers should have be sent after stream is read above") or similar.
| let (ws_stream, _) = match connect_async(request).await { | ||
| Ok(ws) => ws, | ||
| Err(e) => { | ||
| return error!("Failed to connect to WebSocket: {}", e); |
There was a problem hiding this comment.
This is returning () and the user won't see any errors. Could we make the method return either Stream<Item=Result<...>> or Result<Stream<...>> (or even Result<Stream<Item=Result<...>>>) so that the user gets feedback when the connection fails?
| .protocols(ALL_WEBSOCKET_PROTOCOLS) | ||
| .on_upgrade(move |socket| { | ||
| GraphQLWebSocket::new(socket, schema.0, protocol) | ||
| .on_connection_init(|value| async move { |
There was a problem hiding this comment.
What is value here? Can it be named something more descriptive?
| let (endpoint, subscription_endpoint) = ( | ||
| public_address.join("graphql").unwrap().to_string(), | ||
| public_address.join("ws").unwrap().to_string(), | ||
| ); |
There was a problem hiding this comment.
Why merge these into the same statement?
These are the limitation of the tiled server ws
Currently I can get updates on the root node of creation of new node
and patch updates + creation updates for a particular node
To test the subscription to tiled websocket
docker run -d --rm --name tiled-test-redis -p 6379:6379 docker.io/redis:7-alpinetiled serve catalog --temp --api-key secret --cache redis://localhost:6379Todo:
I was not able to pass the API key in the header(Done)testsDone with help from gemini