Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ping method for @shopify/shopify-app-session-storage-redis #724

Open
kibertoad opened this issue Mar 28, 2024 · 5 comments
Open

Expose ping method for @shopify/shopify-app-session-storage-redis #724

kibertoad opened this issue Mar 28, 2024 · 5 comments

Comments

@kibertoad
Copy link

Overview

Since Redis client for @shopify/shopify-app-session-storage-redis is private, there is no easy and cheap way to perform a healthcheck for the Redis connectivity of it.

It would be great if there was a ping() method exposed, which would invoke ping() on a client and return an object of this structure:

{
  isSuccessful: boolean
  error?: Error
}
@kibertoad
Copy link
Author

If there is approval for this request, we can provide a PR for it

@paulomarg
Copy link
Contributor

That sounds like a good idea to me. Another option that might also work and that would give apps more freedom would be the ability to pass in a client like:

import {createClient} from 'redis';
import {RedisSessionStorage} from '@shopify/shopify-app-session-storage-redis';

const client = createClient( ... );
const storage = new RedisSessionStorage(client, { ... });

Since we only use the dbUrl parameter to create a new client ourselves. That way you can do whatever you need to with the client without having to go through the package.

Which do you think would work better here?

@kibertoad
Copy link
Author

kibertoad commented Apr 1, 2024

I agree that supporting client passing would overall provide the most flexibility and is generally a viable solution for the issue at hand.

@paulomarg
Copy link
Contributor

We'll be tracking this issue, but it might be a little bit until we can implement this. If you'd like to contribute with a PR, it'd be most welcome!

@kibertoad
Copy link
Author

@paulomarg Sure, we'll pick it up. Thank you for the reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants