From b6bad85b8a7f9ae4c70a8719b63838952332e8bd Mon Sep 17 00:00:00 2001 From: Wasif Iqbal Date: Wed, 3 Jul 2024 12:13:10 -0500 Subject: [PATCH] fix: update start time to farcaster time when submitting message bundles from sync (#2121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Motivation Describe why this issue should be fixed and link to any relevant design docs, issues or other relevant items. ## Change Summary Describe the changes being made in 1-2 concise sentences. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [ ] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [ ] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. - [x] All [commits have been signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits) ## Additional Context If this is a relatively large or complex change, provide more details here that will help reviewers --- ## PR-Codex overview The focus of this PR is to replace the usage of `Date.now()` with `getFarcasterTime().unwrapOr(0)` in `syncEngine.ts` for more accurate time tracking during message bundle submission. ### Detailed summary - Replaced `Date.now()` with `getFarcasterTime().unwrapOr(0)` for startTime in `syncEngine.ts` - Improved accuracy in time tracking during message bundle submission. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- apps/hubble/src/network/sync/syncEngine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hubble/src/network/sync/syncEngine.ts b/apps/hubble/src/network/sync/syncEngine.ts index be879b0d76..2da9f68f8b 100644 --- a/apps/hubble/src/network/sync/syncEngine.ts +++ b/apps/hubble/src/network/sync/syncEngine.ts @@ -1220,7 +1220,7 @@ class SyncEngine extends TypedEmitter { this._syncMergeQ += messages.length; statsd().gauge("syncengine.merge_q", this._syncMergeQ); - const startTime = Date.now(); + const startTime = getFarcasterTime().unwrapOr(0); const results = await this._hub.submitMessageBundle(startTime, MessageBundle.create({ messages }), "sync"); for (let i = 0; i < results.length; i++) {