-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3532 Dispose realtime docs when no longer in use #3199
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: master
Are you sure you want to change the base?
Conversation
abf739b
to
db6ad5d
Compare
9fcd8f8
to
74cce2c
Compare
e689f5d
to
9d7185b
Compare
e689f5d
to
7842d29
Compare
7842d29
to
b990402
Compare
5a61ab3
to
89e0fd9
Compare
Hello @Nateowami , Thank you for your work on this! Here are some comments on the code. I find positive names to be easier to understand than negative names, when using boolean logic. I suggest to consider renaming Can you explain more about the use of Rather than provide DocSubscription.unsubscribe for situations where a DestroyRef|Observable was not provided to DocSubscription.constructor, do you think we could always require clients to do one of
It looks like if we removed DocSubscription.unsubscribe, and instead had clients pass an Observable, that might look something like // New client field
private readonly bye$ = new Subject<void>();
...
// Pass in constructor
new DocSubscription('DraftGenerationStepsComponent', this.bye$.asObservable())
...
// New client method
wave(): void {
this.bye$.next();
this.bye$.complete();
} I want to mention that we could further reduce the complexity of DocSubscription by changing the constructor destroyRef argument from new DocSubscription('DraftGenerationStepsComponent', this.destroyRef) to something like new DocSubscription('DraftGenerationStepsComponent', new Observable(subscriber => this.destroyRef.onDestroy(() => subscriber.next()))) That makes the client code more complex just to simplify DocSubscription.constructor by a couple lines, so I'm not too inclined toward it. But I wanted to mention that idea in case it inspires other ideas. Sometimes when working in TypeScript it seems like it could be useful to have a standard disposable system. In C#, there is an IDisposable interface, and implementing classes have a
In C#, the IDisposal.dispose method is automatically called if you are |
This reverts commit ab494e6.
2a921bc
to
52e5564
Compare
It bothers me to see all the error messages :) My workstation might start it in 15 s. GHA might start it in 30 s.
@Nateowami Okay, we have a clean run of unit tests and e2e tests. |
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.
@Nateowami reviewed 6 of 132 files at r1, 1 of 9 files at r2, 3 of 3 files at r3.
Reviewable status: 10 of 136 files reviewed, 5 unresolved discussions
src/SIL.XForge.Scripture/ClientApp/e2e/await-application-startup.mts
line 7 at r3 (raw file):
const pollUrl = 'http://localhost:5000/projects'; const pollInterval = 17000;
This is already its own PR, so shouldn't be here.
src/SIL.XForge.Scripture/ClientApp/src/app/app.component.spec.ts
line 133 at r3 (raw file):
await env.navigate(['/projects', 'project01']); flush(); env.init();
Should calling flush()
be part of env.init()
? Or would that not be a good option?
src/SIL.XForge.Scripture/ClientApp/e2e/test_characterization.json
line 12 at r3 (raw file):
"generate_draft": { "success": 1, "failure": 100
I'm guessing these failures are no longer happening? If so this should be reverted.
src/SIL.XForge.Scripture/ClientApp/e2e/presets.ts
line 75 at r3 (raw file):
showArrow: true, outputDir: 'test_output/ci_e2e_test_results', maxTries: 50
Why was this changed?
src/SIL.XForge.Scripture/ClientApp/e2e/workflows/community-checking.ts
line 177 at r3 (raw file):
await page.waitForTimeout(500); } catch (e) { await page.pause();
This should only pause if preset.pauseOnFailure === true
This is still work in progress, but I want to put it out here as it appears to be working.
This change is