DatabaseManager.get() - return `null` instead of `undefined` on empty result
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 50
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
At the moment, DatabaseManager.get() function returns undefined when no record is found. This was in line with older TypeORM!s EntityManager that we were using until recently when we introduced a newer TypeORM version in https://github.com/Joystream/hydra/pull/491.
Let's change the return value to null to align the returning value with EntityManager. The null value is a better representation of empty results anyway, plus easier to work with in JS.
After that, we need to update the code in Joystream QN to reflect this change.
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 at the DatabaseManager.get() entry point and review the TypeORM upgrade in pull request #491 to confirm the expected empty-result behavior. Then trace the Joystream QN code mentioned in the issue and update its handling so the change is complete when empty results return null consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100