Prevent infinite loops on validation

Created on 11 August 2023, over 1 year ago
Updated 6 August 2024, 5 months ago

Problem/Motivation

Redirect works great on detecting redirect loops, but wouldn't be great if we could avoid them to be created in first place?

Steps to reproduce

1. Create /test3 to /test2
2. Create /test2 to /test
3. Create /test to /test3

Actual result:
Redirect is allowed to be created.
If we go to /test, the loop is detected and a message shown.

Desired result:
3) validation fails informing the user about the loop.

Proposed resolution

I'm surprised that this is handled on RedirectSubscription, so might be intentional or the potential solution not desired.
Because the only potential solution I found is actually creating a temporary redirect on validation, and then check the path.
Maintainers need to approve if this is desired or avoided.
Any other better ideas are more than welcome.

Remaining tasks

Validate this is acceptable.
If it is, write tests.

User interface changes

Validation error when loops are detected on form validation.

API changes

None.

Data model changes

Technically, rids will be increased by 2 instead of sequentially. Not sure if that's a cons.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024