Skip to content

Context Logic: Fully move tag changes into context#722

Open
Meow wants to merge 1 commit into
masterfrom
context-logic-step-1
Open

Context Logic: Fully move tag changes into context#722
Meow wants to merge 1 commit into
masterfrom
context-logic-step-1

Conversation

@Meow

@Meow Meow commented Jul 11, 2026

Copy link
Copy Markdown
Member

Serves as an example of how work is expected to be done moving forward. During this, another bug was discovered, where deleting an anonymous tag change caused a crash. This is fixed here.

Fixes #600

@mdashlw

mdashlw commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

fixes #600


Returns `{:ok, reverted_tag_changes}`, `{:error, :unauthorized}`, or
`{:error, :invalid_ids}` when `ids` is not a list. Failures inside the
batch update surface as their own `{:error, _}` shapes.

@liamwhite liamwhite Jul 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"as their own {:error, _} shapes" - unhelpful. Are the error shapes known?

Comment on lines +27 to +30
`actor` may be `nil` for an anonymous visitor. It may also be a
`Philomena.Attribution.Actor`: permissions are decided by its `user` alone -
the IP and fingerprint attribute the action but grant nothing - so contexts
that take an attribution can pass it here unchanged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
`actor` may be `nil` for an anonymous visitor. It may also be a
`Philomena.Attribution.Actor`: permissions are decided by its `user` alone -
the IP and fingerprint attribute the action but grant nothing - so contexts
that take an attribution can pass it here unchanged.
`actor` may be `nil` for an anonymous visitor. It may also be a
`Philomena.Attribution.Actor`, where permissions are decided by its `user` alone.

Comment on lines +332 to +334
An id that cannot name a row is `{:error, :not_found}`, while a well-formed id
that names no row authorizes `nil` - which no rule permits - and is
therefore `{:error, :unauthorized}`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
An id that cannot name a row is `{:error, :not_found}`, while a well-formed id
that names no row authorizes `nil` - which no rule permits - and is
therefore `{:error, :unauthorized}`.
An id that cannot name a row is `{:error, :not_found}`.
A well-formed id that names no row is `{:error, :unauthorized}`.

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.

FunctionClauseError when deleting anonymous user's TagChanges batch from history

3 participants