-
Notifications
You must be signed in to change notification settings - Fork 77
Opening a deleted Item loads indefinitely #2822 #2839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request addresses issue #2822 where opening a deleted Cosmos DB item causes indefinite loading. The changes implement timeout handling for document read operations, add fallback logic using _rid queries, and improve error messaging in the UI.
Key Changes
- Added 4-second timeout for document read operations with fallback to
_ridquery if primary read fails - Introduced
documentErrorevent messaging to properly communicate read failures to the UI instead of using generic query errors - Enhanced UI to display user-friendly error messages when documents cannot be loaded due to deletion or timeout
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
l10n/bundle.l10n.json |
Added localized error message "Item not found or request timed out" for clearer user feedback |
src/webviews/cosmosdb/Document/DocumentPanel.tsx |
Updated loading/error state logic to show appropriate UI when document cannot be loaded |
src/cosmosdb/session/DocumentSession.ts |
Implemented timeout handling with Promise.race, added fallback _rid query, and changed error reporting to use documentError events |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4d8bd43 to
07ee96f
Compare
Added timeout & error message.
07ee96f to
8bc12b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await this.channel.postMessage({ | ||
| type: 'event', | ||
| name: 'documentError', | ||
| params: [this.id, errorMessage], | ||
| }); | ||
| // Still log telemetry but don't use errorHandling which sends queryError | ||
| context.telemetry.properties.error = errorMessage; |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The telemetry properties are set after the documentError event is sent, which means the error information won't be included in the telemetry context that gets logged. This telemetry assignment should happen before the postMessage call to ensure the error details are captured in the telemetry.
| await this.channel.postMessage({ | |
| type: 'event', | |
| name: 'documentError', | |
| params: [this.id, errorMessage], | |
| }); | |
| // Still log telemetry but don't use errorHandling which sends queryError | |
| context.telemetry.properties.error = errorMessage; | |
| // Still log telemetry but don't use errorHandling which sends queryError | |
| context.telemetry.properties.error = errorMessage; | |
| await this.channel.postMessage({ | |
| type: 'event', | |
| name: 'documentError', | |
| params: [this.id, errorMessage], | |
| }); |
This pull request improves the reliability and user experience of reading documents in Cosmos DB by adding timeout handling, fallback logic, and clearer error messaging. The changes ensure that if a document read operation fails or times out, a fallback query by
_ridis attempted, and users receive a more informative error message in the UI when a document cannot be found or retrieved.Error Handling and Messaging Improvements:
"Item not found or request timed out"tobundle.l10n.jsonfor clearer user feedback when document retrieval fails.DocumentSession.readto send adocumentErrorevent with the new message when a document cannot be found or read, instead of sending a generic or query error.Timeouts and Fallback Logic:
_ridquery inDocumentSession, with appropriate logging and error handling for timeouts. [1] [2] [3]_ridis attempted, and detailed logs are generated based on the results.UI Improvements:
Fixes #2822