RocketChat / RocketChat/Rocket.Chat

No test coverage for UploadCreator accessor

Open
#39,803 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
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:

  1. if the descriptor includes a user property, use it directly
  2. if there's a visitorToken (livechat upload), skip user resolution entirely
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.