RocketChat / RocketChat/Rocket.Chat
No test coverage for UploadCreator accessor
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
UploadCreator in packages/apps-engine/src/server/accessors/ has no test file.
this one isn't a simple bridge passthrough — uploadBuffer() has a 3-way conditional for resolving which user the upload belongs to:
- if the descriptor includes a
userproperty, use it directly - if there's a
visitorToken(livechat upload), skip user resolution entirely - if neither is set, fetch the app's system user via
UserBridge.doGetAppUser()
that fallback logic uses hasOwnProperty('user') which means passing user: undefined vs not passing user at all would behave differently — the kind of thing that breaks silently without tests.
putting up a PR for this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/apps-engine/src/server/accessors/ and inspect UploadCreator.uploadBuffer() and the surrounding accessor patterns. Add a test file covering direct user resolution, visitorToken uploads, the UserBridge.doGetAppUser() fallback, and the distinction between user: undefined and an absent user property; done means these branches have regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100