Fix semgrep issues, improve type hints, and add all_subjects field#64
Merged
Conversation
Sync develop to main
Fix semgrep errors
fix: add null checks for frm.timeline in activity.js
…d account identifiers in API and Doctype functions.
…_labels` function.
refactor: Broaden type hints to accept integer values for document an…
feat: Add `all_subjects` field to Gmail Thread
refactor: Replace with for improved quote handling in GmailInboundMail
chore: sync develop to main
niraj2477
approved these changes
May 25, 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.
Description
This pull request introduces a new
all_subjectsfield to theGmail Threaddoctype, enabling efficient searching and filtering across all email subjects within a thread. It also improves type annotations for API functions, enhances frontend robustness, and refines the handling of quoted replies in incoming emails. A database patch is included to backfill the new field for existing records.Added a hidden, read-only
all_subjectsfield to theGmail Threaddoctype for storing all unique subjects from the thread and its emails, enabling list-view filtering across all subjectsUpdated the
before_savemethod ingmail_thread.pyto automatically populateall_subjectsby collecting subjects from both the parent and child emailsAdded a database patch script to backfill the
all_subjectsfield for all existing threadsAdded or improved type annotations for several API functions to clarify expected argument types and improve code reliability
Added
# nosemgrepcomments to suppress security linter warnings where appropriateImproved robustness of timeline refresh logic in the activity JavaScript by adding null checks and ensuring timeline is refreshed only when available
Replaced the
remove_quoted_repliesmethod withpop_down_quoted_repliesinGmailInboundMail, which now normalizes quoted reply containers from various email clients to a consistent Gmail-style format for better frontend rendering and user experienceRelevant Technical Choices
Testing Instructions
Additional Information:
Screenshot/Screencast
Checklist
Fixes #