Skip to content

fix: preserve note permission flags - #107

Open
EastSun5566 wants to merge 1 commit into
developfrom
feature/dev-3076
Open

fix: preserve note permission flags#107
EastSun5566 wants to merge 1 commit into
developfrom
feature/dev-3076

Conversation

@EastSun5566

Copy link
Copy Markdown
Contributor

Fixes #106

Create separate flag definitions for readPermission and writePermission so their values don’t overwrite each other.

@EastSun5566 EastSun5566 self-assigned this Aug 21, 2026
Copilot AI lite review requested due to automatic review settings August 21, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a CLI flag-parsing bug where --readPermission and --writePermission could overwrite each other due to sharing the same Oclif flag definition object, causing readPermission to be dropped in requests.

Changes:

  • Converts notePermission into a factory (notePermission()) so each permission flag gets a distinct flag definition object.
  • Updates notes and team-notes create/update commands to use notePermission() for both readPermission and writePermission.
  • Adds a unit test verifying both permissions are preserved (and that a lone readPermission stays mapped correctly).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/flags.ts Changes notePermission from a shared flag object to a factory to avoid parser overwrite.
src/commands/notes/create.ts Uses distinct flag definitions for readPermission/writePermission via notePermission().
src/commands/notes/update.ts Uses distinct flag definitions for readPermission/writePermission via notePermission().
src/commands/team-notes/create.ts Uses distinct flag definitions for readPermission/writePermission via notePermission().
src/commands/team-notes/update.ts Uses distinct flag definitions for readPermission/writePermission via notePermission().
test/note-permission-flags.test.ts Adds parsing tests to prevent regressions for create/update across personal/team notes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/flags.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: notes create drops readPermission when writePermission is also set

2 participants