Fix: Fix short linking is not enabled by default#1051
Conversation
|
stellar-disbursement-platform-backend-preview is available here: |
|
Something went wrong with PR preview build please check |
There was a problem hiding this comment.
Pull request overview
This PR fixes tenant provisioning so that short-linking is effectively enabled by default by explicitly setting the organization’s is_link_shortener_enabled flag to true after tenant migrations run (avoiding the “existing row backfill” behavior that made the DB default change ineffective).
Changes:
- Update tenant provisioning to set
IsLinkShortenerEnabled=trueon the organization duringsetupTenantData. - Add an Unreleased changelog entry documenting the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
stellar-multitenant/internal/provisioning/manager.go |
Sets IsLinkShortenerEnabled to true when provisioning a tenant so the org row isn’t left backfilled as false. |
CHANGELOG.md |
Documents the fix under Unreleased “Fixed”. |
|
stellar-disbursement-platform-backend-preview is available here: |
|
stellar-disbursement-platform-backend-preview is available here: |
What
Enable
IsLinkShortenerEnabledwhen setup tenantThis is fix to #916
Why
Why my previous change did not work
2023-03-16.0: Creates theorganizationstable and inserts a row — the org row now exists2025-01-30.0: Addsis_link_shortener_enabledcolumn with DEFAULT false — since the row already exists from step 1, PostgreSQL backfills it with false2025-09-20.0(my previous PR): Changes the default to true — but the row already exists with false from step 2, so SET DEFAULT has no effectThe
SET DEFAULTonly applies to futureINSERTstatements that omit the column. But the org row was already inserted in step 1, and the column was backfilled in step 2. By the time my migration runs, there's nothing left to insert — the damage is already done.Known limitations
Since that migration was already merged and deployed, deleting it could cause the migration tool to get confused about its state on those environments. I'd just leave it in place, it's a no-op anyway.
Checklist
SDP-1234: Add new featureorChore: Refactor package xyzformat. The Jira ticket code was included if available.CHANGELOG.mdis updated (if applicable)Contract WASM Artifactsworkflow and open a PR to update the WASMs ondev