saleor / app-sdk

SDK for building great Saleor Apps
Other
49 stars 18 forks source link

Upstash APL write error #198

Closed HazemKhaled closed 1 year ago

HazemKhaled commented 1 year ago

I'm struggling with Upstash recently, but I found the current approach is not working properly

image

the current command ["SET", "${authData.saleorApiUrl}", "${data}"]

sent as

["SET", "https://hazem.eu.saleor.cloud/graphql/", "{"domain":"hazem.eu.saleor.cloud","token":"Ur74MzII5S8tJJ7FEAvSU9d0VLq5Sq","saleorApiUrl":"https://hazem.eu.saleor.cloud/graphql/","appId":"QXBwOjEwNQ==","jwks":" ..... "]

Which needed to escape double quotes, especially in jwks

Solution: Use RedisJSON, which is supported recently by Upstash

check this: https://docs.upstash.com/redis/sdks/javascriptsdk/modules/json#set

lkostrowski commented 1 year ago

@krzysztofwolski can you look into that?

We can check RedisJSON or just escape JWKS (or encode)

krzysztofwolski commented 1 year ago

@HazemKhaled Issue has been fixed in the latest release of the App SDK. Thank you for reporting!