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

chore: send logs query param to status request as true by default #19

Merged
merged 5 commits into from
Oct 26, 2023

Conversation

chamini2
Copy link
Member

@chamini2 chamini2 commented Oct 24, 2023

We are making getting the logs during a status request optional. So enabling this to get them (or not) as necessary.

closes FEA-1645

@linear
Copy link

linear bot commented Oct 24, 2023

Copy link
Collaborator

@drochetti drochetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for doing this!

The question I have is, if the logs are disabled, does the queue status payload still contain an empty logs property? Or is it missing or null?

Asking because queue status is defined like this, with logs always present in case it's IN_PROGRESS or COMPLETED, so is this still correct?

export type QueueStatus =
  | {
      status: 'IN_PROGRESS' | 'COMPLETED';
      response_url: string;
      logs: RequestLog[];
    }
  | {
      status: 'IN_QUEUE';
      queue_position: number;
      response_url: string;
    };

libs/client/src/function.ts Outdated Show resolved Hide resolved
@drochetti
Copy link
Collaborator

Ah, another recommendation I have is to add the option to the fal.subscribe which encapsulates the queue usage, with long polling, etc. So you could add a logs: boolean in the SubscribeOptions type in here https://github.com/fal-ai/serverless-js/blob/0e3cb8593916eeb024a9896c6c7339c9821b3330/libs/client/src/function.ts#L161-L179

Related to that, is the idea to keep as true by default? I thought at first the idea was to add logs only on demand.

@chamini2
Copy link
Member Author

Related to that, is the idea to keep as true by default? I thought at first the idea was to add logs only on demand.

I just wanted to make our client more backwards compatible. I can do whichever

@drochetti
Copy link
Collaborator

Related to that, is the idea to keep as true by default? I thought at first the idea was to add logs only on demand.

I just wanted to make our client more backwards compatible. I can do whichever

got it! I think if the idea is to make logs only available on demand, we can make it false by default since the main user in production relying on logs right now is our own web-app and there it's pinned to a specific version. So when we launch a new version, the web-app will have to upgrade and then can pass true. Wdyt?

Copy link
Collaborator

@drochetti drochetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesooome 🚀

@chamini2 chamini2 merged commit 897fb49 into main Oct 26, 2023
1 check passed
@chamini2 chamini2 deleted the matteo/logs-query-param-status branch October 26, 2023 17:58
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.

2 participants