Open
Conversation
- Fix theme_aggregations to count response_annotations instead of theme_ids - Fix annotation_is_edited to only check for human-assigned themes - Both changes maintain performance improvements while fixing test accuracy
- Use Case/When to OR two conditions: human-assigned themes OR modified_at != created_at - This matches the original is_edited property logic without expensive history queries - Fixes test_get_responses_with_is_flagged[True-True] failure
- Changed second condition from modified_at check to reviewed_by check - Flagging doesn't set reviewed_by, so False case works correctly - Reviewing does set reviewed_by, so True case also works - Avoids false positives from auto_now modified_at updates
- Added third condition: check if annotation has any flags - Uses the through table for flagged_by ManyToMany relationship - Now covers all edit scenarios: human themes, reviews, and flags - All three conditions avoid expensive history table queries
- Removed accidentally duplicated is_read_by_user, annotation_is_edited, and annotation_has_human_assigned_themes - Clean annotate() call with no duplicates
Backend changes: - Add timing logs to ResponseViewSet: list, demographic_aggregations, theme_aggregations - Add timing logs to QuestionViewSet: list, theme_information - Add timing logs to ConsultationViewSet: demographic_options - All logs include duration_ms, consultation_id, and relevant counts - Use structured logger from settings.LOGGER Frontend changes: - Add console.log timing for ConsultationDetail data fetches - Add console.log timing for QuestionDetail data loads - Track individual API calls and total page load times - Include consultation_id, question_id, and result counts in logs Logs are formatted for easy filtering in ECS CloudWatch logs
- Add 'starting' log messages to track when requests begin - Better handle different response data structures (list, dict with results, paginated) - Add queryset build timing to identify query construction overhead - Add warning for unexpected response structures - More accurate question_count and result_count reporting
e622075 to
00e5f9c
Compare
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.
Use preprod for deployment testing