RocketChat / RocketChat/Rocket.Chat

need to change method return type to IAppStorageItem | null, because findOneAndUpdate can return null if the document is not found.

Open Beginner friendly
#41,873 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

todo type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

But for now, we are asserting that it will always return a document.

📝 Found in apps/meteor/ee/server/apps/storage/AppRealStorage.ts#L77

Commit: 03546e6e881a383c3fab48155871b023ccea7bb8

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 at apps/meteor/ee/server/apps/storage/AppRealStorage.ts around line 77 and inspect the findOneAndUpdate call and its current return assertion. Update the method's type handling to reflect that no document may be returned, then run the relevant TypeScript checks or tests for the app storage implementation; done means the return type accurately includes null without type errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.