Skip to content

Conversation

@jankeesvw
Copy link
Contributor

Allow last_active_at to be set via the API, similar to how created_at can already be set (see PR #2056).

This is useful when importing cards from external systems (like GitHub Issues) where we want to preserve the original activity timeline. Without this, all imported cards would have the same last_active_at (the import time), causing incorrect sorting in the triage column and breaking the "not now" feature.

As discussed with @jeremy in #2056 (comment)

This is useful when doing an import from another system. I'm currently
working on a script to import our Github issues into Fizzy.

This is discussed in
basecamp#2056 (comment)
Copy link
Member

@jeremy jeremy left a comment

Choose a reason for hiding this comment

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

Seems a purposeful import API would be helpful. Other folks are going to have to painstaking rediscover these delicate interactions that cascade from newly created items. Simpler if an API-only import resource REQUIRED and preserved these attributes. Could do per-resource imports (boards, cards, comments, etc) and accept nested cards/comments/etc within each.

Adds a safety fallback to Time.current if created_at is unexpectedly nil
during card creation.

Test coverage to verify:
* last_active_at defaults to created_at when not provided
* last_active_at can be updated via API on existing cards
* import workflow where last_active_at is restored after comments
* publishing doesn't overwrite explicit last_active_at values
@jeremy jeremy merged commit 78fc80c into basecamp:main Dec 12, 2025
4 checks passed
@jankeesvw jankeesvw deleted the api-last-active-at branch December 12, 2025 04:21
olivaresf added a commit that referenced this pull request Dec 12, 2025
* origin/main: (67 commits)
  Wrap join code redemption in a lock
  Remove redundant include
  Replace custom code generator with Base32
  Test that you can't go to the magic link screen without an email
  Bundle drift detection and correction (#2101)
  Refactor: Use Rails range syntax in ActivitySpike query (#2080)
  Fix indentation in multi_db.rb initializer (#2082)
  Fix typo in translate property in card columns CSS (#2090)
  Refactor: use idiomatic .last instead of .order(:desc).first (#2098)
  bin/bundle-both (#2100)
  API: Allow updates to `last_active_at` (#2076)
  Move email address into hint line
  Bump fizzy-saas to pickup another staging change.
  Remove the rails credentials from .gitattributes
  Fix typo: minues → minutes
  Fix duplicate word: use use → use
  Add QrCodesController test
  Fix typo in _entropy.html.erb
  Show the email address you are signing in with
  Prohibit access to magic links unless an email address
  ...

# Conflicts:
#	app/controllers/sessions/magic_links_controller.rb
#	app/controllers/sessions_controller.rb
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.

3 participants