Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Claim zaps in batches#1203

Merged
AnthonyRonning merged 1 commit into
masterfrom
batched-hermes
Jun 6, 2024
Merged

Claim zaps in batches#1203
AnthonyRonning merged 1 commit into
masterfrom
batched-hermes

Conversation

@benthecarman

Copy link
Copy Markdown
Collaborator

Helps with #1163

Before we'd claim each zap individually and this could cause problems because relays would send the events with the newest first, so if we stopped claiming the zaps for whatever reason (user closes app), then we'd miss the remaining zaps because we'd set our sync timestamp to the first one we claimed. This fixes this problem by instead accumulating all the zaps until we get the End Of Stored Events message from the relays, and then claiming the zaps, this way we know we got everything from the relay.

@AnthonyRonning

Copy link
Copy Markdown
Contributor

When does the dm sync timestamp saved?

@benthecarman

Copy link
Copy Markdown
Collaborator Author

After an individual ecash notification is handled:

storage.set_dm_sync_time(created_at.as_u64(), true)?;

@AnthonyRonning

Copy link
Copy Markdown
Contributor

After an individual ecash notification is handled:

I don't know what that means. When in the lifetime of an ecash redemption does this even take place?

I guess instead of asking, I should specify that if we're going to move the redemption of the ecash to a batcahable thing in the end, then the timestamp should only be saved once the batched ecash completes fully.

@benthecarman

Copy link
Copy Markdown
Collaborator Author

I see what you're saying, moved it to set the timestamp after the batch, that should be safer

Comment thread mutiny-core/src/hermes.rs
Comment thread mutiny-core/src/hermes.rs
@AnthonyRonning AnthonyRonning merged commit 542a212 into master Jun 6, 2024
@AnthonyRonning AnthonyRonning deleted the batched-hermes branch June 6, 2024 22:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants