-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(inbound-filters): Add inbound filter for ChunkLoadError (OLD) #57343
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #57343 +/- ##
==========================================
- Coverage 78.92% 78.92% -0.01%
==========================================
Files 5116 5116
Lines 220751 220761 +10
Branches 37377 37380 +3
==========================================
+ Hits 174225 174228 +3
- Misses 40895 40905 +10
+ Partials 5631 5628 -3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every thing looks good except for my question about error_messages
Let's figure this out and then it is good to go.
if settings is not None and settings.get("isEnabled", True): | ||
filter_settings[filter_id] = settings | ||
# In order to support the new declarative mechanism for inbound filters also for error messages filters | ||
# we have to handle differently the settings, since each filter will still bind to the same key. | ||
if (messages := settings.get("errorMessages")) is not None: | ||
error_messages += messages | ||
else: | ||
filter_settings[filter_id] = settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss about this.
Would be nice if we could attribute which error message comes from which filter ( on Relay side)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, my implementation is not the best since it's hacky, I would prefer to design from first principles an integration of inbound filters that map to error messages or to top-level filters.
# option was changed by the request | ||
assert project.get_option("filters:chunk-load-error") == "1" | ||
|
||
project.update_option("filters:chunk-load-error", "1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the option is set to a value, do we need to update it to the same value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just to clearly show that we set it to 1
and not leverage the state left by the previous execution but yeah, that could be removed.
This PR implements a new inbound filter for
ChunkLoadError
s in the form:Such inbound filter idea emerged in vercel/next.js#38507.
Closes #57131