diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml index 09840211d..1e1c48b63 100644 --- a/.github/workflows/sync-upstream.yml +++ b/.github/workflows/sync-upstream.yml @@ -42,8 +42,30 @@ jobs: echo "::notice::merge has conflicts — skipping, will retry next run" exit 0 fi + + echo "::group::Verify fork-only auth_url_callback feature survived the merge" + if ! grep -R --include="*.rs" -l "auth_url_callback" . > /dev/null; then + echo "::error::auth_url_callback fork feature is missing after merging upstream/main — aborting sync, not opening a PR" + git checkout origin/main + git branch -D "$BRANCH" + exit 1 + fi + echo "::endgroup::" + + - name: Build and test fork feature gate + run: | + if ! grep -R --include="*.rs" -l "auth_url_callback" . > /dev/null; then + echo "::notice::auth_url_callback not found — skipping build gate (handled above)" + exit 0 + fi + cargo check --workspace --all-features + cargo test --workspace --all-features -- auth_url_callback + + - name: Push branch and open PR + run: | git push -f origin "$BRANCH" gh pr create --repo "$GITHUB_REPOSITORY" --base main --head "$BRANCH" \ --title "Sync from Fork" \ - --body "Automatic weekly sync from \`nats-io/nats.rs@main\`." + --body "Automatic weekly sync from \`nats-io/nats.rs@main\`. Verified that the fork-only \`auth_url_callback\` feature is present and builds/tests successfully after the merge." + diff --git a/async-nats/src/connector.rs b/async-nats/src/connector.rs index 87e5d9ce7..0e6dfe549 100644 --- a/async-nats/src/connector.rs +++ b/async-nats/src/connector.rs @@ -136,9 +136,7 @@ impl Connector { } tracing::error!("Auth URL callback failed or not configured, propagating authorization violation error"); - self.events_tx - .try_send(Event::ClientError(ClientError::Other(error.to_string()))) - .ok(); + return Err(error); } ConnectErrorKind::AuthCallbackReconnect => { // Auth callback succeeded and we need to reconnect with new credentials @@ -152,6 +150,7 @@ impl Connector { self.events_tx .try_send(Event::ClientError(ClientError::Other(other.to_string()))) .ok(); + return Err(error); } }, }