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

Route After Invalidation Config #2613

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

devotox
Copy link

@devotox devotox commented Jul 31, 2023

No description provided.

Copy link
Collaborator

@BobrImperator BobrImperator left a comment

Choose a reason for hiding this comment

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

It'd also be nice to have an acceptance test in the test-app that makes sure the configuration is used correctly.

Comment on lines +57 to +60
this.routeAfterInvalidation =
config.routeAfterInvalidation !== undefined
? config.routeAfterInvalidation
: DEFAULTS.routeAfterInvalidation;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting addition, I like it, it's more descriptive than rootURL but they have the same function.
However I'm not a fan of resolving what route we should redirect to later in the service and I think it should be handled here in the configuration.

rootURL isn't used for anything else and routeAfterInvalidation is basically and alias for it.

I'd suggest something like this, where we either take routeAfterInvalidation value from the configuration or rootURL.

Suggested change
this.routeAfterInvalidation =
config.routeAfterInvalidation !== undefined
? config.routeAfterInvalidation
: DEFAULTS.routeAfterInvalidation;
this.routeAfterInvalidation =
config.routeAfterInvalidation !== undefined
? config.routeAfterInvalidation
: this.rootURL;

This would also need to be explained in the doc accordingly.

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.

None yet

2 participants