-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Server-Sent Events in the Couch DB adapter #3881
Comments
@akhenry I'm a bit concerned with this aspect of Server-Sent events:
Namely, if a user has 6 tabs open to OpenMCT, we may start failing to persist objects on the 7th tab. Is this right? |
I can look at possible multiplexing across tabs (maybe using ServiceWorkers?), or feature-flagging SSE too. |
@scottbell This issue affects all HTTP/1 requests unfortunately. Of course the problem is exacerbated with both SSEs and chunked responses (our current strategy) because they hold the connection open indefinitely. We are solving this right now by multiplexing through a shared worker. So long as we continue to use a shared worker with SSEs we're fine. On a side note, Safari does not support shared workers, because they inexplicably removed support for them years ago. There are some recent signs that they may be re-implementing support though. So right now we do feature detection for SharedWorkers and just fall back on a regular connection if SharedWorkers are not available. Our only use case for Safari is mobile support in iOS, which is a requirement. Hopefully Safari will get shared workers soon, and if it doesn't we will have to figure something out for iOS down the line. |
We've run into similar issues with shared workers and Safari on other projects, so I feel your pain. One thing to think about though with iOS, users typically do less tabbed browsing, so maybe a straight SSE connection would be ok. In any event, I will start the SSE work using shared workers! Thanks for the insights |
@akhenry Between 1.7.7 and 1.7.8, when using the CouchDB persistence plugin, this line: |
I think the source of the bug is before the |
Yeah, looks like the underlying model is missing. I wonder if it's a timing issue. Namely, we're trying to persist before the model is ready |
Ah, narrowed it down a bit. Undoing this PR: |
Ah, rumor has it @shefalijoshi may have a fix. I'll chat with her. |
Found @shefalijoshi's fix: |
Though I've resolved the issue of saving objects to CouchDB through @shefalijoshi's fix, it looks like the synchronization is still broken. For example, creating an object of
This is because the active transaction is null:
which causes the |
This appears to be a timing issue. This: |
I think the cancel is happening because the
|
Still looks like an interplay between transactions and what the persistence plugin is expecting. In Later, the transaction is committed, and this call |
Adding a null check seems to fix it:
@akhenry @shefalijoshi I'm a bit lost on the observer interaction, but would the above be ok? |
Split the Notebook Object issue to: |
A PR for this issue has been opened here: |
Testathon 12-13-21 - no testing notes. |
@scottbell Is there a good way to test this? |
Testing NotesEach of the following must be performed with Safari and also with Chrome (not at the same time).
|
I'm seeing an issue where opening notebook another tab results in the user not being able to create an entry on the second tab. Steps to reproduce:
@michaelrogers noted that you can navigate away from the notebook and back to it in the same tab to get in this same state. Screen.Recording.2022-01-06.at.5.02.42.PM.mov |
Tried to modify a notebook entry in different tabs and the entries did not update consistently. I think this could have something to do with default notebooks not working as expected. I suggest waiting for #4469 to be merged before testing this again. |
Post #4469 being merged, it looks like it's working in 1.8.3 (at least on my local install): Screen.Recording.2022-01-07.at.12.54.40.PM.mov |
Re-opening. There are some scenarios which are not working and need additional debugging. Note this may have to do with active / inactive tab |
Closed in favor of #4737. After investigation it has been determined that notebook issues are unrelated to Server Sent Events. |
Server Sent Events provide a cleaner interface for receiving change events from the Couch Server than handling chunked HTTP responses.
The text was updated successfully, but these errors were encountered: