Conversation
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.
Summary of Changes
When a user clicks on a newly arrived email (polled via
emailLatest) or navigates to an email before the background listfull=1fetch completes, the email body (content) is empty (""), rendering a completely blank screen below the header until the user manually refreshes the page.Root Causes
contentwithout caching:In
emailService.latest, the query usedemailBriefColumnsand calledapplyListText(list), explicitly deletingitem.content. The frontendlatest()loop added the email item to the scroll list without populatingdetailMap.The backend previously had no dedicated
/email/detailendpoint to retrieve a single email's full body on demand.content/index.vue:content/index.vueonly rendered whatever was inemailStore.contentData.email. Ifcontentwas empty, it rendered an empty block indefinitely without attempting to fetch the details.Solutions Applied
mail-worker):GET /email/detail?emailId=:emailIdinemail-api.jsandemailService.detailto fetch complete content and attachments for a specific email with permission checks.emailService.latestandallEmailLatestto query full columns and load attachments (emailAddAtt). Real-time polling typically returns only 1–2 items, so returning complete content introduces no performance penalty while eliminating race conditions.mail-vue):views/email/index.vueandviews/all-email/index.vue, newly polled emails are immediately cached intoemailStore.detailMap[email.emailId] = email.store/email.js,toContentEmailretainscontentandtextif already present in the passed object.views/content/index.vue):loadMissingDetail()): Ifcontentis missing when opening an email, it displays an animated skeleton and immediately fetches the full email viaemailDetail(emailId), populatingdetailMapand rendering seamlessly.