-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
WGPS progress tracking #35
base: main
Are you sure you want to change the base?
Conversation
Ah, that also fixes #26 I think. |
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.
Fantastic, only a few nitpicks!
src/wgps/events.ts
Outdated
constructor(todo: number, all: number) { | ||
super("status", { | ||
detail: { | ||
todo, |
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.
Nitpick: could we change this to remaining
, as at least for me todo
triggers thoughts of 'oh, I guess this is something someone forgot to do'?
src/wgps/range_counter.ts
Outdated
private count = 0n; | ||
private inProgress = new Set<bigint>(); | ||
|
||
constructor() {} |
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 can be snipped
@@ -3180,3 +3477,18 @@ export class StoreMap< | |||
return newStore; | |||
} | |||
} | |||
|
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.
Thank you so much for making these tests better.
Fixes also a bug where a received ReconciliationAnnounceEntries message with wantResponse = true did not increase your_range_counter.
Currently the status will indicate done even when some entries are yet to be processed, e.g. storing them. That's why there is still a small(er) delay.
Done :-) |
Tracks range counters on both sides. WGPS emits a StatusEvent with simple { todo: number, all: number } info. This is now also used in some tests where reconciliation is expected, to lower the delay. { todo: 0 } could still have some unprocessed entries in some store promise, so still little delay is needed for now.