-
Notifications
You must be signed in to change notification settings - Fork 125
fix(sync): reset #sending flag when no active connection on sendStepsNow #8796
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,17 @@ const initialData = { | |
| const openResult = { connection, data: initialData } | ||
|
|
||
| describe('Sync service', () => { | ||
| it('resets #sending when there is no active connection', async () => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test looks useless to me, I'd drop it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, but I'm not at home right now. When I am, I'll definitely make some edits based on your suggestions. Thank you very much!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @omnizs38 can you simply drop the test altogether from the PR? Also, out of curiosity:
|
||
| const { connection, openConnection } = provideConnection( | ||
| { fileId: 123, relativePath: './' }, | ||
| vi.fn(), | ||
| vi.fn(), | ||
| ) | ||
| const service = new SyncService({ connection, openConnection }) | ||
| await service.sendStepsNow() | ||
| await expect(service.sendStepsNow()).resolves.toBeUndefined() | ||
| }) | ||
|
|
||
| it('opens a connection', async () => { | ||
| const getBaseVersionEtag = vi.fn() | ||
| const setBaseVersionEtag = vi.fn() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a sensible fix to me. We return early but don't reset
this.#sending.