I’m running into an issue with a backend workflow. I’ve had to do a manual OAUTH 2 integration with the Bubble API Connector which is working fine. As a part of that, I save a refresh token and “expires at” values. Expires at are coming in as Epoch values.
As certain events come in as webhooks, they could come in when the user doesn’t have a valid access token since they expire every 6 hours. The webhook creates fine, but to get more detail, I need to run a check on whether their access token is valid before fetching the data from an external API.
My problem is that Bubble seems to be ignoring the “only when” condition and running the refresh anyways.
The flow I has is the following:
- User’s access token “expires at” is converted from Epoch (s) to UNIX (ms) by multiplying by 1000 when it’s created. This works fine.
- Webhook comes in, and it creates the thing. This is fine.
- Schedule an API Workflow is run to get the new access token, “only when expires at is less than or = to current time:extracted to UNIX”
Baffled as to why the access token workflow is run regardless of the true/false of the “only when” check. I manually put in some text boxes and the same only when statement in on a conditional box and it all calculates correctly. Is there something I’m missing in terms of how only when is used?
Thanks in advance!