Add TTL or clear-subscriptions command
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.5k
- Forks
- 468
- Avg merge
- 3h 9m
- Merged PRs (30d)
- 2
Description
Currently, the subscriptions continue to broadcast events until the channel is deleted with the webhook. One problem with this technique, is that local dev-environments are usually not available to Pusher. An other problem is that any failed webhook-calls in production, will result in a subscription living on indefinitely.
It seems like the Pusher API can deliver information about users in a particular channel. This should allow us to retain any channels that still has an active subscriber. However, the TTL will avoid going through all channels that are most likely still in use, since they are eg. less 1 hr old.
I suggest that we add a new command, php artisan lighthouse:clear-subscriptions -TTL 3600, that will delete any vacant channels that have expired it's TTL (1 hr in this case). This new command can easily be added to the schedular and used manually during development.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Laravel Artisan command entry points and trace how subscriptions and channel deletion are currently handled. Define the TTL and vacant-channel behavior from the issue, then verify that an equivalent clear-subscriptions command can be run manually and scheduled without removing channels with active subscribers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100