feat: Sink url shortner for sms workflow reminders#26608
feat: Sink url shortner for sms workflow reminders#26608keithwillcode merged 19 commits intomainfrom
Conversation
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
…nk_shortner_for_sms_reminders_workflows
Udit-takkar
left a comment
There was a problem hiding this comment.
I am getting this error
b:dev: 09:26:09:241 [ERROR] sink-url-shortener Sink API error: 401 - {
@calcom/web:dev: "error": true,
@calcom/web:dev: "url": "https://sink.amit-b43.workers.dev/api/link/create",
@calcom/web:dev: "statusCode": 401,
@calcom/web:dev: "statusMessage": "Unauthorized",
@calcom/web:dev: "message": ""
@calcom/web:dev: }
Udit-takkar
left a comment
There was a problem hiding this comment.
We should use a combination of strategy + factory pattern here and we should use global feature flags to decide which one to use and it would be easier to add more/ replace with another url shortner service.
For eg:-
export class SinkShortener implements IUrlShortenerProvider {
constructor(private client: SinkClient) {}
async shortenMany(urls: string[]) {
const results = await this.client.createMany(urls);
return results.map(r => ({
shortLink: r.shortLink || r.url
}));
}
}
export class UrlShortenerFactory {
static create(): IUrlShortenerProvider {
// Check feature flag here instead of env vars
if (process.env.SINK_API_KEY) {
return new SinkShortener(new SinkClient());
}
if (process.env.DUB_API_KEY) {
return new DubShortener();
}
return new NoopShortener();
}
}
|
There is also
|
Devin AI is resolving merge conflictsThis PR has merge conflicts with the Devin will:
If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself. |
Co-Authored-By: unknown <>
Co-Authored-By: unknown <>
|
Merge conflicts resolved and pushed. The single conflicted file ( Note: Unable to remove the |
E2E results are ready! |
|
We discussed internally and @Amit91848 is going to add a TeamFeatureFlag for this so we can slowly roll out. |
…s://github.com/calcom/cal.com into feat/sink_shortner_for_sms_reminders_workflows
For dub fallback, add the following to .env before merging
What does this PR do?
Uses https://github.com/miantiao-me/sink hosted on cloudflare workers.
Fixes GTM-239
For testing you can add this in .env
SINK_API_URL=https://sink.amit-b43.workers.dev
SINK_API_KEY=(present in bitwarden under name Sink url shortner)
Dashboard: https://sink.amit-b43.workers.dev/dashboard/login
Pass: same as SINK_API_KEY present in bitwarden
Follow https://github.com/miantiao-me/Sink/blob/master/docs/deployment/workers.md for prod setup
Visual Demo (For contributors especially)
Screen.Recording.2026-01-09.at.4.09.46.PM.mov
Mandatory Tasks (DO NOT REMOVE)
Summary by cubic
Adds a pluggable, user/team-aware URL shortener for SMS workflow reminders that prefers Sink (feature-flagged), then Dub, then original URLs. Removes hardcoded Dub settings and aligns with Linear GTM-239.
New Features
UrlShortenerFactoryselectsSinkShortenerwhensink-shorteneris enabled (globally, per user, or per team viaFeaturesRepository); elseDubShortener; elseNoopShortener. Used inee/workflows/lib/reminders/utils,ee/workflows/api/scheduleSMSReminders, andsmsReminderManager(now passesuserId/teamId).DUB_SMS_DOMAIN/DUB_SMS_FOLDER_IDto Dub;.env.exampledocumentsSINK_API_URL/SINK_API_KEYand optional Dub SMS vars;lib/constantsexports both Dub SMS values.sink-shortenerflag toAppFlags/useFlags; seeds via migration. New@calcom/features/url-shortenermodule withSinkClient, providers, and factory; broad test coverage for shorteners, factory, reminder utils, andscheduleSMSReminders.Migration
SINK_API_URLandSINK_API_KEY, then enable thesink-shortenerfeature globally, per user, or per team.DUB_SMS_DOMAINandDUB_SMS_FOLDER_ID.Written for commit ffbeac0. Summary will update on new commits.