nextcloud / nextcloud/end_to_end_encryption

Remove duplicate metadata type declarations from `src/models.ts`

Open
#2,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop technical debt
Dominant language
PHP
Stars
320
Forks
36
Avg merge
1d 8h
Merged PRs (30d)
81

Description

While looking at some version discrepancies like this one:

https://github.com/nextcloud/end_to_end_encryption/blob/9bfa09fb3afaaafc774e408cda293e294c7b8cdd/src/models.ts#L43

... I noticed that src/models.ts contains metadata types that duplicate the declarations in src/models/metadata.d.ts. These have drifted -- for example, Metadata.version only permits '2.0', while the implementation supports and emits '2.1'.

Migrate remaining consumers, primarily test fixtures, to the more authoritative IRawMetadata, IRawRootMetadata, and related types, then remove the duplicate declarations from src/models.ts.

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 src/models.ts and compare its metadata declarations with src/models/metadata.d.ts, focusing on the authoritative IRawMetadata, IRawRootMetadata, and related types. Search the remaining consumers, especially test fixtures, and update them to use those declarations. Done means the duplicate declarations are removed from src/models.ts and the affected consumers still type-check and pass their tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
security
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.