#3171: Errors on Domain Request Auditlogs - [MS] #3305
+3
−1
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.
Ticket
Resolves #3171
Changes
Context for reviewers
Error logs have been showing up on stable that we couldn't explain. Turns out they were caused by an insufficiently specific database query that was pulling in some auditlogs for unrelated objects that happened to have the same object id. The hard part for this PR is just testing, see below for details.
Setup
Code Review Verification Steps
This issue is caused by auditlogs existing for a domainrequest object and a domaininvitation object that have the same object_id. I have manually created such a situation for stay-year-relate.gov on MS. To test this, you must navigate to that domain in the domain request admin panel, and then observe logs (for example by searching on logs.fr.cloud.gov using the filter
@cf.app: getgov-ms AND @source.type: APP
over the last X minutes. Initially you should see no errors like "An error occurred during change_view: 'invited' is not a valid DomainRequest.DomainRequestStatus". Note that it can take a few minutes for logs to populate, so maybe get coffee or something first. The error should not be there because the fix is deployed. If you want to be thorough, deploy main to MS and repeat this behavior to prove that the log appears without the fix.As the original developer, I have
Satisfied acceptance criteria and met development standards
Ensured code standards are met (Original Developer)
Validated user-facing changes (if applicable)
As a code reviewer, I have
Reviewed, tested, and left feedback about the changes
Validated user-facing changes as a developer
Note: Multiple code reviewers can share the checklists above, a second reviewer should not make a duplicate checklist. All checks should be checked before approving, even those labeled N/A.
As a designer reviewer, I have
Verified that the changes match the design intention
Validated user-facing changes as a designer
References
Screenshots