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

Authorizer: Avoid cancelling the log parser on success #56

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

chenxiaolong
Copy link
Owner

Instead, let the log parser stop itself when it sees MARKER_CODE_STOP, which will always be present for the success flow.

The previous behavior of explicitly cancelling the log parser when Rcbridge.rbAuthorize() returns is unfortunately prone to a race condition. It turns out that logging from the golang side is not synchronous, so the log message containing the token would sometimes occur after the cancellation message.

Fixes: #55

Instead, let the log parser stop itself when it sees MARKER_CODE_STOP,
which will always be present for the success flow.

The previous behavior of explicitly cancelling the log parser when
Rcbridge.rbAuthorize() returns is unfortunately prone to a race
condition. It turns out that logging from the golang side is not
synchronous, so the log message containing the token would sometimes
occur after the cancellation message.

Fixes: #55

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong self-assigned this Apr 29, 2024
@chenxiaolong chenxiaolong merged commit 7e3c1e3 into master Apr 29, 2024
chenxiaolong added a commit that referenced this pull request Apr 29, 2024
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong deleted the logging-race branch April 29, 2024 21:31
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.

Bug: nothing happens when adding "drive" backend after authorizing rclone app in browser and returning to RSAF
1 participant