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: values order with non-GET requests #2749

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

Telroshan
Copy link
Collaborator

Description

Former implementation of overrideFormData was overriding all values for a given key, one key after the other, thus breaking the initial order of values.
This situation wasn't caught by existing tests (see 01b292a), as the tested case was a GET request, for which we don't run the values override with the closest form's values.

This PR fixes #2703 by overriding values in order using forEach on the FormData, ensuring to preserve the initial order

Corresponding issue: #2703

Testing

Added a test case for a POST request as well

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added bug Something isn't working 2.0 labels Jul 21, 2024
@Telroshan Telroshan changed the title Fix values order with non-GET requests #2703 Fix values order with non-GET requests Jul 21, 2024
@Telroshan Telroshan changed the title Fix values order with non-GET requests Fix: values order with non-GET requests Jul 21, 2024
@Telroshan Telroshan added the ready for review Issues that are ready to be considered for merging label Jul 21, 2024
Copy link
Collaborator

@alexpetros alexpetros left a comment

Choose a reason for hiding this comment

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

Thanks as always for adding a new test :)

@alexpetros alexpetros merged commit bec3657 into bigskysoftware:dev Jul 26, 2024
1 check passed
@Telroshan Telroshan deleted the fix-values-order-non-get branch July 26, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 bug Something isn't working ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants