Skip to content

added-rescan-progress-issue-744#894

Merged
theborakompanioni merged 8 commits intojoinmarket-webui:develfrom
18c83fd3-25ea-4ed9-8205-2abeff9b3883:add-rescan-issue-744
May 2, 2025
Merged

added-rescan-progress-issue-744#894
theborakompanioni merged 8 commits intojoinmarket-webui:develfrom
18c83fd3-25ea-4ed9-8205-2abeff9b3883:add-rescan-issue-744

Conversation

@18c83fd3-25ea-4ed9-8205-2abeff9b3883
Copy link

@18c83fd3-25ea-4ed9-8205-2abeff9b3883 18c83fd3-25ea-4ed9-8205-2abeff9b3883 commented Apr 27, 2025

Resolves #744.

cleaner fix

@18c83fd3-25ea-4ed9-8205-2abeff9b3883 18c83fd3-25ea-4ed9-8205-2abeff9b3883 changed the title added-recan-progress-issue-744 added-rescan-progress-issue-744 Apr 28, 2025
@theborakompanioni
Copy link
Collaborator

Nice @18c83fd3-25ea-4ed9-8205-2abeff9b3883! Really looks cleaner than the first PR. Thanks!

Two things come to mind:

  • There needs to be a way to toggle this behaviour to only be executed for backend version >= v0.9.12 (not released yet). Or at least execute it once and then stop if it is unsupported e.g. if given a 404 error.
  • From my pov it seems 2s interval is quite frequent. The call will invoke getblockchaininfo on bitcoin core and might not need to be done this often. What do you think?

@18c83fd3-25ea-4ed9-8205-2abeff9b3883

Added a flag isRescanProgressApiSupported to track if the API is supported
Added logic to stop trying to fetch rescan progress.
Changed interval from 2s to 10s

@theborakompanioni
Copy link
Collaborator

Added a flag isRescanProgressApiSupported to track if the API is supported Added logic to stop trying to fetch rescan progress. Changed interval from 2s to 10s

🙏 🚀

What are those additional fix_ and update_ files?

@18c83fd3-25ea-4ed9-8205-2abeff9b3883

Utility scripts I made changes with and forgot to clean up after myself. DELETED Should be good to go now.

Comment on lines 223 to 226
// Initialize rescanProgress to undefined to avoid briefly showing old progress
dispatchServiceInfo({
rescanProgress: undefined,
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not here actually.. but before you schedule with setInterval, no?

@18c83fd3-25ea-4ed9-8205-2abeff9b3883

improve error handling in the ServiceInfoContext.tsx file:

  • Added initialization of rescanProgress to undefined to the beginning of the useEffect hook, before setting up the interval,

  • Changed the error handling to catch all non-OK responses, not just 404 status.

  • Simplified the error handling in the catch block to treat all errors the same way, marking the API as not supported or temporarily unavailable.

@theborakompanioni theborakompanioni self-requested a review May 2, 2025 19:30
offer_list: Offer[] | null
nickname: string | null
rescanning: boolean
rescan_progress?: number
Copy link
Collaborator

@theborakompanioni theborakompanioni May 2, 2025

Choose a reason for hiding this comment

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

Last things before we can merge.. /session response does not contain a rescan_progress property. Please remove it.

(This causes the scanning text to flicker as the /session call updates it to undefined and the /getrescaninfo updates to the actual progress number)

Other than that, I think it is ready to be merged.

@18c83fd3-25ea-4ed9-8205-2abeff9b3883

done. thanks for the feedback

@theborakompanioni
Copy link
Collaborator

done. thanks for the feedback

How are you so freaking fast? Amazing.

Copy link
Collaborator

@theborakompanioni theborakompanioni left a comment

Choose a reason for hiding this comment

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

Thanks @18c83fd3-25ea-4ed9-8205-2abeff9b3883.
Wonderful job! 🙏 🧡

@theborakompanioni theborakompanioni merged commit c608c58 into joinmarket-webui:devel May 2, 2025
1 check passed
@18c83fd3-25ea-4ed9-8205-2abeff9b3883 18c83fd3-25ea-4ed9-8205-2abeff9b3883 deleted the add-rescan-issue-744 branch May 2, 2025 20:17
theborakompanioni added a commit that referenced this pull request May 9, 2025
* chore(894): unset progress if rescanning ended

* chore: remove manually added line from changelog

* cleanup: remove unneeded code comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: show progress during rescan

2 participants