Title: Race condition sending subscription while socket is connected, but before op=connected · Issue #46 · parse-community/ParseLiveQuery-Android · GitHub
Open Graph Title: Race condition sending subscription while socket is connected, but before op=connected · Issue #46 · parse-community/ParseLiveQuery-Android
X Title: Race condition sending subscription while socket is connected, but before op=connected · Issue #46 · parse-community/ParseLiveQuery-Android
Description: Subscribe to queryA it is not connected yet, so it will trigger reconnect. Socket opens, thus state=CONNECTED Sends op=connect Subscribe to queryB SOCKET is connected (state=CONNECTED), but we haven't received op=connected yet. BUG: it w...
Open Graph Description: Subscribe to queryA it is not connected yet, so it will trigger reconnect. Socket opens, thus state=CONNECTED Sends op=connect Subscribe to queryB SOCKET is connected (state=CONNECTED), but we have...
X Description: Subscribe to queryA it is not connected yet, so it will trigger reconnect. Socket opens, thus state=CONNECTED Sends op=connect Subscribe to queryB SOCKET is connected (state=CONNECTED), but we have...
Opengraph URL: https://github.com/parse-community/ParseLiveQuery-Android/issues/46
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Race condition sending subscription while socket is connected, but before op=connected","articleBody":"1. Subscribe to queryA\r\n - it is not connected yet, so it will trigger reconnect.\r\n2. Socket opens, thus state=CONNECTED\r\n - Sends `op=connect`\r\n3. Subscribe to queryB\r\n - SOCKET is connected (state=CONNECTED), but we haven't received op=connected yet.\r\n - BUG: it will call sendSubscription now, because it only checks current state\r\n4. Server responds to (2) with `op=connected`\r\n5. On op=connected, we replay pending subscriptions, including the one that was already sent in (3)\r\n\r\nThat results in sending JSON over the socket in this order:\r\n\r\n1. socket CONNECT\r\n2. send op=connect\r\n3. send op=subscribe (query A)\r\n4. receive op=connected\r\n5. send op=subscribe (query A)\r\n6. send op=subscribe (query B)\r\n\r\nThat results in having 2 subscriptions for query A, and one for query B, when we should only have one of each.\r\n\r\nI have a unit test that proves this, and a fix will be forthcoming.","author":{"url":"https://github.com/jhansche","@type":"Person","name":"jhansche"},"datePublished":"2017-04-27T00:19:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/46/ParseLiveQuery-Android/issues/46"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bd79c4ab-996d-6dbb-2b64-2863ce8eb28c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F06:2EAD2D:46B27C6:5E462E8:6A5D9B0B |
| html-safe-nonce | 0093e0a2361f09f97762f6ac6e900c2eb947665207236f91de09a3c0a26a544f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjA2OjJFQUQyRDo0NkIyN0M2OjVFNDYyRTg6NkE1RDlCMEIiLCJ2aXNpdG9yX2lkIjoiOTIwOTc1Mjg5MDYxNzIwNzU2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0db68de1e5c284d9bf3b16e69fdd629a62dc68cc7e04991b8a890046d5b86021 |
| hovercard-subject-tag | issue:224635214 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/parse-community/ParseLiveQuery-Android/46/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4de143d2026bd691697924968af742c489b30a5583b6d5d2e0ff3b28eafa544b/parse-community/ParseLiveQuery-Android/issues/46 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4de143d2026bd691697924968af742c489b30a5583b6d5d2e0ff3b28eafa544b/parse-community/ParseLiveQuery-Android/issues/46 |
| og:image:alt | Subscribe to queryA it is not connected yet, so it will trigger reconnect. Socket opens, thus state=CONNECTED Sends op=connect Subscribe to queryB SOCKET is connected (state=CONNECTED), but we have... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jhansche |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/parse-community/ParseLiveQuery-Android git https://github.com/parse-community/ParseLiveQuery-Android.git |
| octolytics-dimension-user_id | 26932219 |
| octolytics-dimension-user_login | parse-community |
| octolytics-dimension-repository_id | 68854119 |
| octolytics-dimension-repository_nwo | parse-community/ParseLiveQuery-Android |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 68854119 |
| octolytics-dimension-repository_network_root_nwo | parse-community/ParseLiveQuery-Android |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width