Patch: Fixes Github Issue 357: Ensure user object is consistently passed to DocumentStore service methods - #373
Merged
Merged
Conversation
- Fixed refreshDocStoreMiddleware controller to pass user object instead of userId/organizationId - Fixed upsertDocStoreMiddleware controller to pass user object instead of userId/organizationId - Fixed refreshDocStoreMiddleware service to include user object in totalItems array - Resolves GitHub issue #357 - Cannot read properties of undefined (reading 'id') error
bugfix: document store refresh fails due to undefined user object
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
user object is consistently passed to DocumentStore service methods
maxtechera
temporarily deployed
to
staging - theanswer-iek0
July 8, 2025 20:50 — with
Render
Inactive
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.
PR Title
Fix: Ensure
userobject is consistently passed to DocumentStore service methodsDescription
🐛 Bug Fix
This PR addresses an inconsistency in how user-related metadata was passed to the
DocumentStoreServicemethodsupsertDocStoreMiddlewareandrefreshDocStoreMiddleware. Previously, onlyuserIdandorganizationIdwere passed individually, while other parts of the system expect the fulluserobject.✅ Changes
userIdandorganizationIdwith the fulluserobject (req.user) in both:upsertDocStoreMiddlewarecontroller methodrefreshDocStoreMiddlewarecontroller methoddocumentstore/index.ts) properly consumes and forwards theuserobject when building internal payloads (e.g.docIdanduserpairing for loaders).🧯 Why This Fix Matters
Some downstream logic (e.g., audit logging, scoped permissions, or async processing of loader entries) depends on the full
userobject being available. This fix ensures consistency and prevents unexpectedundefinedaccess errors during doc store operations.🚀 Release Notes
Fixed a bug where only partial user data was sent to the document store service, potentially breaking downstream logic relying on the full user context. Now the full
userobject is consistently passed during both document upsert and refresh operations.