playframework / playframework/playframework
CacheBuilder is hard to use with ActionBuilder
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 12.6k
- Forks
- 4k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 29
Description
Play Version (2.5.x / etc)
master
API (Scala / Java / Neither / Both)
Scala
Actual Behavior
play.api.cache.Cached uses a CachedBuilder which generates an EssentialAction rather than an Action
This means that it's hard to use Cached in action composition, because composeAction takes an Action and not an EssentialAction:
It's not clear what the advantage is in returning EssentialAction, and I think this can be changed without consequence.
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 with Cached.scala around line 118 and Action.scala around line 450 to trace the return type from CachedBuilder and the type expected by composeAction. Confirm whether changing the generated action type preserves the existing behavior; done means Cached can be used with composeAction without an EssentialAction mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100