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

feat(cargo-shuttle): adaptive page hints, non-breaking #1334

Closed
wants to merge 3 commits into from

Conversation

x04
Copy link
Contributor

@x04 x04 commented Oct 22, 2023

Description of change

Changed the project and deployment commands to only return page hint if the items returned == limit.

Mostly closes #1316

How has this been tested? (if applicable)

Tested with local setup

)
);

if deployments.len() == limit as usize {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like it! But I guess this will still be wrong when there are exactly limit projects, right? Could we change the limit logic to be limit + 1, then only display limit projects. So say there are 15 projects, we have a limit of 10 and we show those 10, but we got 11, so we know there are more projects on the next page.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, and a cargo fmt should fix CI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it! But I guess this will still be wrong when there are exactly limit projects, right? Could we change the limit logic to be limit + 1, then only display limit projects. So say there are 15 projects, we have a limit of 10 and we show those 10, but we got 11, so we know there are more projects on the next page.

Yes I did something similar to what you described in a separate PR in this commit:
25b382d

However I was instructed to change it to just return a record count vs a bool for the next page so I made that change and that PR still remains open here:
#1320

However the changes are breaking so I made this that can be merged without breaking.

Copy link
Contributor Author

@x04 x04 Oct 23, 2023

Choose a reason for hiding this comment

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

Oh I just reread this as I was checking up on the PR and I realized you meant doing the limit + 1 on the client-side, I can definitely change it to do that and as you mentioned it's 100% accurate whereas this can falsely hint at a next page, I was just doing it on the server-side not the client-side which caused it to be breaking.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, sorry for not making that clear! 😄 It would be great if you could implement this and resolve the conflicts, then I think we can get this merged for the next release.

@oddgrd
Copy link
Contributor

oddgrd commented Nov 1, 2023

Superseded by #1357

@oddgrd oddgrd closed this Nov 1, 2023
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.

[Improvement]: Remove redundant hint based on row count
2 participants