🐛 Bug: Slack link expires after a while
Describe the bug
The Slack link that we use is https://json-schema.org/slack, which redirects to https://json-schema.org/redirect-slack, which subsequently redirects to the actual Slack link.
Currently the Slack link is
https://join.slack.com/t/json-schema/shared_invite/zt-32yapp69j-viHPdH93MA7_qgjyI6rmLA
which I can't find in the admin console to renew. So the "join Slack" links that we have everywhere are broken.
The Slack documentation says that links are only active for 30 days and for only up to 400 people. It seems Slack doesn't expect to be used by open communities.
I did find that you can create a perpetual link from within Slack, but the 400 people cap still applies.
https://files.slack.com/files-pri/T5CHC2TAN-F09ARMYP30F/image.png
What we need
We need some way to identify when the link has expired and automatically renew or replace it.
Open to ideas.
Discussed in https://github.com/orgs/json-schema-org/discussions/633
Originally posted by Praashh February 22, 2024
Hey there! I am not able to join the slack, can anyone help to get into slack, getting this
Steps To Reproduce
Expected Behavior
Sign in to slack
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
No
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
No
Hi @gregsdennis! I can help automate this issue by creating a script that monitors the Slack link, generates new invites via API when expired, and updates the redirect automatically. is this approach is what we are looking for? If this passes triage, I'd love to work on this issue. Thanks
@vtushar06 its not possible to generate new invite link in free plan of slack. I am thinking we have paid plan but I did some research and I think its not possible to generate a universal invite link when it expires automatically through the API even if we have the paid plan, here's an alternative to how we can automate the invite
- while its not possible to create a new universal invite link without manual interference of creating a invite link, we can create an endpoint/script which will accept a email from a form and send them an auto generated invite link from slack API for that email via admin.users.invite, this method doesn't have any limitations and can be used many times.
In any case we would require access to the admin API of slack which we don't have
Let me know your thoughts on this @gregsdennis would love to help in any way in implementation or any other part.
Thank you @animeshsahoo1 for the valuable insights about Slack's API limitations and the individual invite approach using admin.users.invite. Your research into the technical constraints is spot-on and very helpful.
Building on both our ideas, I'd like to propose a hybrid solution that combines the strengths of monitoring automation with the practical individual invite approach:
Proposed Hybrid System:
- Primary: Automated monitoring of universal invite link status with proactive alerts to maintainers
- Fallback: When universal link expires/reaches capacity, seamlessly switch to an email collection form
-
Backend: Process emails via
admin.users.inviteAPI for individual invitations - UX: Users experience zero downtime - either direct Slack access or quick email-to-invite flow
This approach maintains the optimal user experience when universal links work while providing automatic scaling beyond Slack's limitations when they don't.
If this direction sounds promising and admin API access is available, I'd be happy to implement this solution. I believe it addresses the core issue comprehensively while being resilient to Slack's constraints. and @animeshsahoo1 lets wait for maintainers for further review.
@gregsdennis Would love to hear your thoughts on this approach!
@vtushar06 yeah that's a nice suggestion as well but I think if we already are making email system then making a hybrid of both email and invite link increases the complexity of the code for not much advantage, I think its better to reduce complexity but again let's other people decide and give any alternative views.
@animeshsahoo1 I see your point about complexity. My thinking was that the hybrid approach offers better UX since users get instant access when the universal link works, and only fall back to email when needed.
But you're right - if we're building the email system anyway, maybe that complexity isn't worth it. I'm open to either approach.
What do you think @gregsdennis? Start simple with email-only or worth having both options?
I really don't have a preference of how this gets fixed, honestly.
@gregsdennis maybe we can go with only email approach cause I remember benjamin said in a issue he wants code complexity to be as less as possible, in reference to that do you want me to try implementing the email approach if this passes triage but without the slack API key ,I might not be able to test it though.
We are creating a link that never expires, but it does. I prefer not to use the Slack API to automate new invitation links, as it would also require automating some Cloudflare tasks. I created a new "never expires" link and updated the redirect. Let's see if it works this time.
I also simplified the redirect to remove the logic associated with https://json-schema.org/redirect-slack. Now the invite link is directly associated with https://json-schema.org/slack as a regular Cloudflare rule.
Hi @benjagm, Thanks for simplifying the redirect and testing the “never expires” link. I’m happy to help with this if needed in the future. Please let me know if I can assist. Thanks
@benjagm — the “never-expires” link you dropped in back in Aug still good? If it’s quietly died again and no one’s actively on it, could you assign #1818 to me? I’ll wire up a tiny uptime monitor that pings the invite endpoint daily and auto-opens a ticket (or even a PR against the Cloudflare redirect) the moment Slack returns a 4xx.