Commit Graph

16 Commits

Author SHA1 Message Date
Rosa Gutierrez 92cb749e16 Fix tests for renamed fixtures and new stacked notifications
Clear assignee's existing notifications in setup since Notifier now
uses create_or_find_by instead of create, and reload the association
to avoid caching after destroy_all.

Update fixture references after rebase: use `logo_assignment_kevin`
as base notification and `logo_mentioned_david` for mention tests.
Update source to `logo_published` in tests that need generic card events.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 19:31:13 +01:00
Rosa Gutierrez 9ded80d448 Add test for notifying new mentionees when editing a comment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:56:27 +01:00
Rosa Gutierrez 3e5233239b Fix push notification not firing on notification creation
- Rails only applies the last callback when `after_create_commit` and
  `after_update_commit` reference the same method name [1]:

> However, if you use the `after_create_commit` and the
`after_update_commit` callback with the same method name, it will only
allow the last callback defined to take effect, as they both internally
alias to `after_commit` which overrides previously defined callbacks
with the same method name.

- Push notifications were never sent when a notification was first
  created — only when the source was updated
- Replaced the two callbacks with a single `after_save_commit`, which
  fires on both create and update, with the
  `source_id_previously_changed?` guard (true for both new records and
  source changes)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

[1] https://guides.rubyonrails.org/active_record_callbacks.html#aliases-for-after-commit
2026-02-20 18:37:33 +01:00
Mike Dalessio 9aa15e9fb2 Forbid comments on draft cards
- Add Card#commentable? method that returns true only for published cards.
- CardsController#create ensures that the card is commentable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 11:28:26 -05:00
Jorge Manrubia 29d07e7326 Fix: not detecting mentions when publishing saved drafts
The problem was that publishing a card with `#publish` was tracking the event
after updating the status, which was clearing the saved changes and preventing the
code from detecting the mention.

See:
https://app.fizzy.do/5986089/cards/2835
2025-12-01 15:39:45 +01:00
Jorge Manrubia 56a85c261b Remove plain text mentions
They can cause duplicates

https://app.fizzy.do/5986089/cards/2874

Closes #https://github.com/basecamp/fizzy/pull/1549
2025-11-11 10:01:59 +01:00
Jorge Manrubia b686936230 Fix: extract mentions when publishing cards
This wasn't working when creation and publishing happened on separated instances
of the same record, which is what happens when you edit a draft and then you
publish it

https://app.fizzy.do/5986089/cards/2835/edit
2025-11-10 13:08:29 +01:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Jorge Manrubia 17f9df8df3 Don't create mentions from drafts until those are published
https://fizzy.37signals.com/5986089/collections/2/cards/982
2025-07-04 17:25:39 +02:00
Jorge Manrubia 5c98744743 Support rich text mentions 2025-06-20 10:39:22 +02:00
Jorge Manrubia e8cffd0717 Add missing test 2025-04-24 12:37:25 +02:00
Jorge Manrubia 38e16ab9ee Remove dummy test I had created for debugging purposes 2025-04-24 12:20:25 +02:00
Jorge Manrubia d2237c2a68 Remove trace 2025-04-23 23:19:38 +02:00
Jorge Manrubia 2545604659 Add tests 2025-04-23 17:20:04 +02:00
Jorge Manrubia c3cd873588 Rename collect => create 2025-04-23 10:30:30 +02:00
Jorge Manrubia aa3acfeaa8 Add plain text mentions 2025-04-22 11:26:56 +02:00