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

fix: Context updating, environment rate limiting, toggle styling #437

Conversation

cdelst
Copy link
Contributor

@cdelst cdelst commented Sep 27, 2024

We now query environments by name, instead of all X at once up front.

image

image

image

image

@cdelst cdelst requested a review from mike-zorn September 27, 2024 21:43
@cdelst cdelst changed the title Fix context updating, fix environment rate limiting, fix toggle fix: Context updating, environment rate limiting, toggle styling Sep 27, 2024
updateOverride(flagKey, newValue);
}}
/>
<div className="animated-switch-container">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The styles broke for our launchpad component. I want to get this fix out before debugging that, so for now I created a new style that styles correctly.

We were having issues with the styling regarding rems and correctly spacing the switch anyway, so this improves overall looks too at the cost of custom css.

@@ -0,0 +1,77 @@

.animated-switch-container {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to be honest, most of this was written with Cursor. It looks great to me, and functions perfectly, so not questioning it.

It can be removed when we figure out the Switch issue in launchpad.

Copy link

@vroske-ld vroske-ld left a comment

Choose a reason for hiding this comment

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

i have a couple of questions! also, i found an error when switching to a couple of specific environments. it might be outside the scope of this specific PR but wanted to raise what i found:

when trying to switch to production i got:

PATCH http://localhost:5173/api/dev/projects/default 500
{
    "code": "internal_server_error",
    "message": "unable to get source flags from LD SDK: LaunchDarkly client initialization failed"
}

i also experienced this when switching to catfood, but not other environments like my own local dev, back to staging, etc.

Comment on lines -87 to -89
if limit != nil {
request = request.Limit(*limit)
}

Choose a reason for hiding this comment

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

i think we still need this in some form? i don't see the limit from the frontend being respected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh huh, interesting. I'll debug this. Thanks for testing and calling it out!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, turns out I forgot to add it back 😅

Comment on lines 71 to 77
useEffect(() => {
const filtered = environments?.filter(
(env) =>
env.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
env.key.toLowerCase().includes(searchQuery.toLowerCase()),
);
setFilteredEnvironments(filtered);
setFilteredEnvironments(filtered || []);
Copy link

@vroske-ld vroske-ld Sep 30, 2024

Choose a reason for hiding this comment

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

it's not clear to me if we still need to have a reference to filteredEnvironments in addition to just environments. it seems like the intention was to limit the number of envs we get upfront, so the filtering should now be happening on the backend rather than the frontend? please correct me if i've misunderstood 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh yea I think you're right! The backend is now doing the filtering :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@cdelst
Copy link
Contributor Author

cdelst commented Sep 30, 2024

@vroske-ld I am making a ticket to investigate your unrelated issue.

@cdelst cdelst requested a review from vroske-ld September 30, 2024 23:33
@cdelst cdelst merged commit c7832d5 into main Oct 1, 2024
9 checks passed
@cdelst cdelst deleted the cdelst/FUN-231/rate-limits-not-respected-by-launch-devly-environment-fetches branch October 1, 2024 00:24
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