CP-14193 Add external_id persistence tests#73
Merged
Conversation
What Adds test coverage confirming DocuSeal already persists the submitter `external_id` field end-to-end — through both the service layer and the API request path. No production code changes. Why ATS will now send `external_id` (`ats-user-<id>`) on every submitter so it can match submitters by stable user id instead of mutable email. These tests pin DocuSeal's existing pass-through behavior so it cannot regress silently. How to test bundle exec rspec spec/lib/submissions/create_from_submitters_spec.rb \ spec/requests/submissions_spec.rb
spaulsandhu
reviewed
Jun 17, 2026
Comment on lines
+98
to
+100
| template.submitters.map.with_index do |s, index| | ||
| { 'uuid' => s['uuid'], 'email' => Faker::Internet.email, | ||
| 'external_id' => "ats-user-#{index + 1}" }.with_indifferent_access |
Member
There was a problem hiding this comment.
Part of me wonders if we should encrypt the payload somehow so that we're not transmitting plain IDs, but I won't block this PR over that, just something to think about 🤔
Collaborator
Author
There was a problem hiding this comment.
🤔 The user IDs are already exposed in ATS URLs/views (they're database PKs), the external_id is never browser-visible (matching is server-side via slug lookup), and we're already transmitting plain task-assignment-#{id} in the same payload unencrypted. I'm not sure this is worth it at this point.
spaulsandhu
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CP-14193
What
Adds test coverage confirming DocuSeal already persists the submitter
external_idfield end-to-end — through both the service layer and the API request path. No production code changes.Why
ATS will now send
external_id(ats-user-<id>) on every submitter so it can match submitters by stable user id instead of mutable email. These tests pin DocuSeal's existing pass-through behavior so it cannot regress silently.How to test
bundle exec rspec spec/lib/submissions/create_from_submitters_spec.rb spec/requests/submissions_spec.rb