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

[Bug]: throwing new z.errors.RefreshAuthError() doesn't retry performUnsubscribe #664

Open
misterjoshua opened this issue Jun 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@misterjoshua
Copy link

misterjoshua commented Jun 14, 2023

Bug Description

In a hook-based trigger, when new z.errors.RefreshAuthError() is thrown during performUnsubscribe because an OAuth2 access token has expired, refreshAccessToken is called, but performUnsubscribe doesn't run again. As a result, my API never receives the unsubscribe message.

Reproduction Steps

Here are traces from my OpenTelemetry instrumentation:

image

In this trace, here's what I did:

  • Created a zap with my app as a trigger
  • Connected my account
  • Got to the place where the Zapier web ui wants me to wait for the first event (subscribe @ 02:26:50)
  • Waited until the access token expired then ran "test connection" from the Zapier web UI
  • Observed as the first testAccess failed because it threw z.errors.RefreshAuthError() (02:31:41)
  • Observed as Zapier ran refreshAccessToken then re-ran testAccess - at this point, it's clear that autoRefresh: true works for connection testing
  • Waited for the access token to expire then deleted the connection from the "app connections" screen in the Zapier web UI
  • Observed that the unsubscribe failed because it threw z.errors.RefreshAuthError() (02:38:17)
  • Observed Zapier attempting to run refreshAccessToken again
  • But this is where it stops. It doesn't re-run the unsubscribe.

Zapier Platform version

14.1.1

Node.js version

18.13.0

Your Operating System

Linux Ubuntu 22.04 in WSL

npm/yarn version

3.5.1

App ID

185407

More Details

I can remove authorization checking based on the access token from my unsubscribe endpoint if this is the expected behaviour. I think all I'd need to do is add some sort of shared secret in the subscribeData that I echo back when unsubscribing.

@misterjoshua misterjoshua added the bug Something isn't working label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant