Skip to content
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 ReconciliationSendPayload with maximum peer size #32

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

xash
Copy link
Contributor

@xash xash commented Nov 13, 2024

Implements this TODO: "We should check if the entry's payload length is less than our partner's maximum_payload_size and send the payload, but at the time of writing time is short and that requires something of a refactor to the announcer."

Announcer passes Payload iff it wants it to be send immediately.

@sgwilym
Copy link
Contributor

sgwilym commented Nov 13, 2024

Wonderful, this feature saves a lot of roundtrips! Would it be possible to add a test for this, so that we can catch regressions in future?

@xash
Copy link
Contributor Author

xash commented Nov 14, 2024

There wasn't a way to test for specific packets except awkwardly capturing console.log's output – so I replaced the log with a onMessage callback that can be used for testing/debugging. Alternative to the callback would be wiretaping the transports between Alfie/Betty and decoding the packets, but that seems to troublesome with the very stateful protocol. Anyway, now there is a proper test for the maximum peer size limit. (-:

@sgwilym
Copy link
Contributor

sgwilym commented Nov 15, 2024

Wow, thank you. That onMessage callback you added will come in handy.

@sgwilym sgwilym merged commit 624a601 into earthstar-project:main Nov 15, 2024
1 check passed
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