Skip to content

webui: add an authorized rclone remote only once - #14

Draft
ash-iir wants to merge 1 commit into
mainfrom
fix-oauth-double-add
Draft

ash-iir wants to merge 1 commit into
mainfrom
fix-oauth-double-add

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 19, 2026

Copy link
Copy Markdown
Owner

When the user comes back from the OAuth consent page, focus and visibilitychange both call pollAuthorize(), and the interval may already have one in flight. Each poll that saw done called addRemote(), so the remote could be stored twice (or the second call failed with "already exists").

The done branch now returns unless _authActive is still set; the first poll clears it, so later ones do nothing.

Testing

  • node --check on scripts.js.
  • Not tested on a device.

Coming back from the consent page fires focus and visibilitychange, and
the interval may have a poll in flight too. Every poll that saw done
called addRemote. Only the first one, while _authActive is set, does.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
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.

1 participant