Skip to content

Retain all form params in duplicate check interstitial pages#1023

Open
Copilot wants to merge 6 commits intomainfrom
copilot/fix-dupe-check-interstitial-params
Open

Retain all form params in duplicate check interstitial pages#1023
Copilot wants to merge 6 commits intomainfrom
copilot/fix-dupe-check-interstitial-params

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

What is the goal of this PR and why is this important?

Person and user creation forms lose all data when duplicate detection triggers. Users filling complex forms with nested attributes (sectors, organizations, addresses, profile settings) must re-enter everything after clicking "Go Back" or "Create Anyway" from the duplicate check page.

How did you approach the change?

Session storage on redirect:

  • Store complete form params in session before redirecting to check_duplicates
  • Clear session on successful save to prevent stale data

View updates:

  • Retrieve stored params in check_duplicates actions
  • Render all params as hidden fields in "Create Anyway" form using recursive helper
  • Pass params to "Go Back" link for form repopulation
  • Fallback to URL params when session empty (backwards compatibility)

Helper method:

# app/helpers/application_helper.rb
def hidden_fields_for_params(params_hash, prefix = nil)
  # Recursively renders nested hashes/arrays as hidden input tags
end

Controllers:

# Before redirect
session[:person_create_params] = params[:person].to_unsafe_h

# After save
session.delete(:person_create_params)

Anything else to add?

56 existing tests pass. Added 6 new tests validating param retention through duplicate check flow.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • vite
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/people_check_duplicates_spec.rb spec/requests/users_check_duplicates_spec.rb --format documentation _64-linux-gnu/12/cc1 2f4e1c8a2d7be9957dd5af35cfdef9e145f/log.json -plugin-opt=-pas-w by/backward _64-linux-gnu/12security -c (dns block)
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/users_check_duplicates_spec.rb:56 --format documentation nat 2f4e1c8a2d7be9957dd5af35cfdef9e145f/log.json OUTPUT -d 127.0.0.11 /node_modules/@esbuild/linux-x64--mode --wa�� e test nat /usr/local/bin/node 2f4e1c8a2d7be9957dd5af35cfdef9e145f/cec878078105d0d890c9b7f808610415167ad162df4820aec43d5f1e54d1bfca.pid -d 127.0.0.11 45f/log.json (dns block)
    • Triggering command: /usr/local/bin/bundle bundle exec rspec spec/requests/users_check_duplicates_spec.rb:56 --format documentation --backtrace in/node fb2ce4bdb0b7cb16bash -I /cc1 b82b582b5e42e3cba1ea1b89ab4fa8058e69.pid in/v�� (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits February 15, 2026 13:34
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with dupe check interstitial pages for user creation Retain all form params in duplicate check interstitial pages Feb 15, 2026
Copilot AI requested a review from maebeale February 15, 2026 14:28
@maebeale maebeale marked this pull request as ready for review February 15, 2026 21:33
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