juspay / juspay/purescript-redis

retryStrategy doesn't work properly

Open
#30 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PureScript
Stars
5
Forks
11
PR merge metrics
No merged PRs in 30d

Description

According to ioredis JS [spec](https://github.com/luin/ioredis), to disable reconnecting you need to pass anything that is not a number. But the `retryStrategy` option in PureScript does not support this "not a number" result because it returns `Int`. Hopefully, it's possible to return `unsafeCoerce "dummy"` to the `retryStrategy` option, and it will raise exception and stop reconnecting on evaluation. However it's not a valid way I think. It would be better to allow the `retryStrategy` option to have another type: `SimpleConOpts -> Maybe Int` and convert this `Maybe` before passing to JS function.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the retryStrategy option and the SimpleConOpts definition, then inspect how the PureScript option is converted for ioredis. Verify that a Maybe Int can represent both a retry delay and disabled reconnecting, and test both outcomes against the ioredis behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, redis
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.