sync: version 16 to v1.0.1#68
Merged
Merged
Conversation
…set attachment limit
Two bugs in the old per-attachment loop:
1. frappe.db.get_value("File", file_doc_name, "file_url") returns None
when the File row has been deleted. The function then wrote
attachment["file_url"] = None and returned it. The timeline_message_box
template renders a.file_url.split("/") to derive the filename, which
crashed with "Cannot read properties of null" — the whole form
timeline failed to render.
2. The frappe.db.get_value call was inside the per-attachment loop,
so a thread with N attachments did N round-trips against tabFile.
Now a single frappe.db.get_all collects every referenced file_url, and
attachments whose File row is gone are dropped from the returned list
so the template never sees a null file_url.
Improve attachment handling and sync_labels_api robustness
Chore: Bump version from 1.0.0 to 1.0.1
niraj2477
approved these changes
Jun 2, 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
Bump version from 1.0.0 to 1.0.1
This pull request introduces several improvements to how Gmail attachments and email synchronization are handled, with a focus on robustness, compatibility, and code clarity. The main changes include enhanced parsing and validation of attachment data, improved API flexibility, and better compatibility with Frappe's email handling.
Attachment handling improvements:
get_attachments_datafunction inactivity.pynow robustly parses and validates theattachments_datafield, handling both JSON strings and lists, logging errors for invalid data, and ensuring only attachments with validfile_urlvalues are returned. It also batches database queries for efficiency.API and function enhancements:
sync_labels_apifunction ingmail_account.pynow accepts arguments as either a string, dictionary, or None, improving flexibility and type safety. It also adds better error handling for missing required arguments.Email processing compatibility:
GmailInboundMailclass inhelpers.pynow accepts an optionalemail_accountparameter, ensuring compatibility with Frappe'sEmailclass and handling missingattachment_limitattributes gracefully.create_new_emailfunction inhelpers.pyis updated to pass thegmail_accountto theGmailInboundMailconstructor, ensuring proper initialization.Code cleanup:
jsonimports from multiple files for clarity and to prevent confusion.Relevant Technical Choices
Testing Instructions
Additional Information:
Screenshot/Screencast
Checklist
Fixes #