Skip to content

WGPS progress tracking#35

Open
xash wants to merge 3 commits into
earthstar-project:mainfrom
xash:progress
Open

WGPS progress tracking#35
xash wants to merge 3 commits into
earthstar-project:mainfrom
xash:progress

Conversation

@xash
Copy link
Copy Markdown
Contributor

@xash xash commented Nov 21, 2024

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.

@xash
Copy link
Copy Markdown
Contributor Author

xash commented Nov 21, 2024

Ah, that also fixes #26 I think.

Copy link
Copy Markdown
Contributor

@sgwilym sgwilym left a 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!

Comment thread src/wgps/events.ts Outdated
constructor(todo: number, all: number) {
super("status", {
detail: {
todo,
Copy link
Copy Markdown
Contributor

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'?

Comment thread src/wgps/range_counter.ts Outdated
private count = 0n;
private inProgress = new Set<bigint>();

constructor() {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be snipped

return newStore;
}
}

Copy link
Copy Markdown
Contributor

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.

xash added 3 commits November 22, 2024 18:12
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.
@xash
Copy link
Copy Markdown
Contributor Author

xash commented Nov 22, 2024

Done :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants