Several packages had the same dependency listed in both `dependencies`
and `devDependencies`. This removes the duplicate from whichever section
is incorrect based on actual usage in the source code.
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Address reviewer feedback:
- Use a dedicated migrations table to avoid conflicts with the parent plugin
- Use database-native now() instead of JS Date for timestamp columns
- Use database-level interval arithmetic for cleanup retention cutoff
Signed-off-by: Erik Miller <erik.miller@gusto.com>
When a Backstage notification is re-sent with the same scope, the
notifications backend updates the existing DB record and sets
notification.updated. Previously, the SlackNotificationProcessor always
called chat.postMessage(), creating duplicate Slack messages.
This adds database-backed scope-based update support:
- New slack_message_timestamps table to persist Slack message ts values
keyed by (scope, channel)
- After each chat.postMessage(), store the response ts in the database
- When postProcess receives a notification with updated set and a
matching stored ts, use chat.update() instead of chat.postMessage()
- Scope context is passed as parameters through the call chain to avoid
race conditions with concurrent postProcess calls
- Scheduled daily cleanup of old timestamp records (24h retention)
- New messagesUpdated metrics counter for observability
- Graceful degradation when no database is provided
- Explicitly picks only supported fields for chat.update calls
Signed-off-by: Erik Miller <erik.miller@gusto.com>
Add a `toError` utility function to `@backstage/errors` that converts
unknown values to `ErrorLike` objects. If the value is already error-like
it is returned as-is. Strings are used directly as the error message, and
other values are stringified with a fallback to JSON.stringify to avoid
unhelpful `[object Object]` messages.
Non-error causes passed to `CustomErrorBase` are now converted and stored
using `toError` rather than discarded. Existing `assertError` call sites
across the codebase are migrated to `toError`.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor