Repository navigation
fix(platform): close the #3806 cloud import and bulk send findings - #3905
Merged
Merged
Conversation
Importing a selected folder lists it again. A success: false answer to
that walk was thrown as a plain Error, so the import's toast showed the
provider's own text under the localized Import failed, such as
`OneDrive API error: 403 {"error":…}`. An import answered success: false
showed its error field, the backend's English.
The walk now throws a CloudListingError, as the picker's listings do.
The catch logs its message and shows common.errors.generic; a refusal
keeps its words through failureDetail, and a folder too large to list
keeps its localized sentence. An unsuccessful import answer reads the
generic line too, and its error goes to the log. The OneDrive,
SharePoint and Google Drive walks are covered through the real adapter
rows.
The listing-failure proof covered the files listings and one lapsed grant on the SharePoint drives listing, while the automation register claimed every SharePoint listing. Removing the sites, drives or files listing toast failed no test, nor did dropping the sites or files listing from the lapsed-grant check. Each SharePoint listing (the sites, a site's libraries, a library's files) now answers success: false, a refusal and a lapsed grant through the real query and adapter row: one title-only toast after three attempts, one toast with the refusal's words, and a handoff to the connect dialog with no toast. The KNOW-B16 row names the listings it covers.
Each send of a bulk send is quiet at its hook, so the summary toast is the only report of a refused send, and it gave the counts alone. A status verb whose batch was refused beside answered ones did the same; only a verb that changed nothing said why. Both summaries now add the first refusal's words after the counts through conversations.bulk.outcomeWithReason in English, German and French, read through firstFailureDetail and failureDetail. A conversation without a contact email reads in the page's language, a door's refusal in its own words, and a fault adds nothing. The Inbox guide and the manual layer say so.
yannickmonney
deleted the
fix/cloud-import-raw-error-bulk-send-reason
branch
September 29, 2026 14:09
This was referenced Sep 29, 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.
Follow-up to #3806 (one failure, one toast), from its review. Each of the three open items was re-checked on main before coding. #3784, which the brief says overlaps the bulk-send item, has since merged, so the bulk-send change builds on it.
What changed
1. Cloud import never shows the provider's raw answer (OneDrive, SharePoint, Google Drive)
When a person imports a selected folder,
collectAllFileslists that folder again. Asuccess: falseanswer to that walk was thrown as a plainError.failureDetailreturns a plain Error's message as-is, so the import toast showed the provider's own text under the localized Import failed / Sync failed. Before the fix, the new test got this toast:What changed, in both
onedrive-import-dialog.tsxandgoogle-drive-import-dialog.tsx:CloudListingError, the class the picker's listings already use (queries.ts).console.warnand showscommon.errors.generic.failureDetail:common.errors.sessionEnded.documents.onedrive.folderTooLargeToImportstill shows.success: falseno longer shows itserrorfield. That field is the backend's English, and in practice it is always the grant check's sentence (tokenForin the import routes). The toast readscommon.errors.generic, andresult.errorgoes to the log.2. The bulk summaries carry the first refusal's words (en/de/fr)
Each send in a bulk send is quiet at its hook (
errorToast: false). The summary toast is therefore its only report, and it gave only the counts.handleSendMessagesnow collects the rejected reasons in selection order. When any send failed, it appendsfirstFailureDetail(reasons)to the counts through a new key,conversations.bulk.outcomeWithReason('{outcome} — {reason}'), in en/de/fr. What that reason reads:panel.contactEmailNotFound, in the page's language.Found by the sweep, same concept and same file: a status verb whose batch was refused beside answered batches also gave only counts. #3784 names the reason only when nothing changed.
runStatusVerbnow appendsfailureDetail(outcome.firstError)through the same key.The Inbox guide (EN/DE/FR
docs/*/platform/index.md) and theCONV-F34box now say that the message gives the first failure's reason.3. The SharePoint listings are proven as the
KNOW-B16row claimscloud-import-dialogs.listing-failure.test.tsxnow drives each SharePoint listing (the sites, a site's libraries, a library's files) through the real query and adapter row, with three answers each:success: falseresolveGraphTokenForUsersends)onRequireConnectis called and no toast is raisedThe same file drives the import walk for OneDrive, SharePoint and Google Drive with three answers: a raw answer, a refusal, and a folder too large to list.
Manual-layer updates in
tests/manual/reference/automation.md:KNOW-B16row names the listings it covers.CONV-F10/F28/F34row and the "one failure, one toast" row cover the bulk summaries.How I verified it
All local runs used a sandbox shared with other agents (load average up to about 140 on 4 cores). Workspace-wide gates are left to CI.
Tests with the change (all green):
cloud-import-dialogs.listing-failure.test.tsxonedrive-import-dialog.test.tsxgoogle-drive-import-dialog.test.tsxcloud-import-dialogs.lapsed-session.test.tsxdocuments-table.test.tsx+use-listing-failure-toast.test.tsuse-bulk-actions.test.ts+use-bulk-actions.send-summary.test.tsxhome-inbox-list.wire.test.tsx+home-inbox-list.test.tsx+conversations.test.tsx(these import the bulk hook), counted together with the row aboveerror-message-description,single-failure-toast) +lib/i18n/messages.test.ts5b10a3c57services/docs, 7 files)Negative controls (new tests run against the unfixed code):
HEAD: 7 failures. These are the three walk cases (OneDrive, SharePoint, Google Drive) plus two per dialog test file. All 36 other tests pass.use-bulk-actions.tsatHEAD: 11 failures. These are every en/de/fr summary case plus the status-verb partial-refusal case.Mutations on
onedrive-import-dialog.tsx. Each row removes oneuseListingFailureToastcall (sites / drives / SharePoint files) or drops one listing fromisMicrosoftAccountError.After this PR, each mutation is caught by exactly the test for its own listing.
Static checks:
oxlint --type-awareon the changed files: clean.oxfmt --check: clean.tscover the changed files and what they import: clean.bun run lint:manual: ok.check-guide.tsonconversations.md: OK. It reports no new findings onautomation.md.Left open, for a decision rather than this PR
common.errors.generic. Before, it read the English sentence "…is not authorized for importing. Connect … from Documents." The listings hand a lapsed grant to the connect dialog instead. Doing the same on the import path (for example,isCloudImportAuthError(error)→handleDisconnected()) would be a small follow-up, but it changes the flow, so I left it out.success: falsewith afailedCountand noerror) still reads Import failed with the generic line, even when most files landed. This is unchanged from before.firstFailureDetailreads only the first failure. When the first failure is a fault and a later one is a refusal, the summary shows counts only. This is the shared helper's existing behaviour, and every batch surface uses it.