devlooped / devlooped/WhatsApp
Add simple mechanism to generate TTL-like tokens for flows
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 13
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
A flow's token is used to resume previously started flows. If a subsequent CTA for the same flow with the same token is received, WhatsApp will consider it a continuation of a previously started one and potentially present partially filled data to continue.
Developers might want to limit that time (defaults to no TTL, basically unless an actual token is provided), so a convenience TimeSpan-based approach can be provided.
It can be as simple as a time bucket such as:
long seconds = DateTimeOffset.UtcNow.ToUnixTimeSeconds() / 60; // use minutes
long window = (long)TimeSpan.FromDays(3).TotalSeconds / 60; // minutes too
long bucket = (seconds/ window);
Since flows under a minute of TTL are really impractical (users won't have time to even complete one in that time, so continuing for longer time seems reasonable), we turn seconds to minutes so the resulting bucket number is smaller. 3 days is also something mentioned even in the docs.
Perhaps this should be an overload of CallToAction(...) for the flow-based overloads?
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 by locating the flow-based CallToAction entry points and the existing token handling; the issue names no files or tests. Determine the intended TimeSpan-based TTL behavior and overload scope, then verify that generated tokens stop continuing a flow outside the selected time window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100
