Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR significantly simplifies the IMAP implementation by consolidating fragmented services and switching from Key Changes:
Benefits:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client as IMAP Client
participant GetList as ImapGetMessageListService
participant Sync as ImapSyncService
participant GetMsg as ImapGetMessagesService
participant Parser as ImapMessageParserService
participant Extractor as ImapMessageTextExtractorService
Note over Client,Extractor: Message List Sync Flow
GetList->>Client: getMailboxLock(folderPath)
Client-->>GetList: lock acquired
GetList->>Client: Read mailbox state
Client-->>GetList: uidValidity, maxUid, highestModSeq
GetList->>Sync: syncFolder(client, folder, cursor, state)
Sync->>Sync: validateUidValidity()
alt QRESYNC Available
Sync->>Client: search({modseq, uid}, {uid: true})
Client-->>Sync: new/modified message UIDs
else Fallback to UID Range
Sync->>Client: search({uid: range}, {uid: true})
Client-->>Sync: new message UIDs
end
Sync-->>GetList: {messageUids}
GetList->>GetList: Create sync cursor
GetList->>Client: release lock
GetList-->>Client: messageExternalIds, nextSyncCursor
Note over Client,Extractor: Message Fetch & Parse Flow
GetMsg->>GetMsg: groupByFolder(messageExternalIds)
loop For each folder
GetMsg->>Parser: parseMessagesFromFolder(uids, folder, client)
Parser->>Client: getMailboxLock(folderPath)
Client-->>Parser: lock acquired
Parser->>Client: fetchAll(uidSet, {uid, source}, {uid: true})
Client-->>Parser: raw message data
loop For each message
Parser->>Parser: PostalMime.parse(source)
Parser-->>Parser: parsed email
end
Parser->>Client: release lock
Parser-->>GetMsg: MessageParseResult[]
loop For each parsed result
GetMsg->>Extractor: extractTextWithoutReplyQuotations(parsed)
Extractor-->>GetMsg: cleaned text
GetMsg->>GetMsg: buildMessage(parsed, uid, folder)
end
end
GetMsg-->>Client: MessageWithParticipants[]
|
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:32493 This environment will automatically shut down when the PR is closed or after 5 hours. |
charlesBochet
approved these changes
Dec 4, 2025
|
Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
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.
No description provided.