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

Issue on caching array of strings , wrongly objectified. #2314

Open
1 of 4 tasks
vithoSmile opened this issue Oct 10, 2024 · 2 comments
Open
1 of 4 tasks

Issue on caching array of strings , wrongly objectified. #2314

vithoSmile opened this issue Oct 10, 2024 · 2 comments

Comments

@vithoSmile
Copy link

vithoSmile commented Oct 10, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a
    minimal reproduction available on
    Stackblitz.
    • Please install the latest @envelop/* packages that you are using.
    • Please make sure the reproduction is as small as possible.
  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

Hi, I am an user of Yoga GraphQL Server, not directly @envelop/response-cache
Probably and issue from @graphql-yoga/plugin-response-cache" which uses @envelop/response-cache:6.2.1.
Yesterday, there was 2 updates 6.2.2, then 6.2.3.

To Reproduce Steps to reproduce the behavior:

In 6.2.1, I was able to use Yoga, in stitching mode, it returns response correctly (array of strings like this) :

    "data": {
        "productsByAcCodeCarrouselCollection": {
            "items": [
                {
                    "title": "Test HP Product Slider",
                    "acCodes": [
                        "AC3459838",
                        "AC3420927",
                        "AC03461816",
                        "AC03461807",

But since the upgrade to 6.2.3, it give me this response :

"data": {
        "productsByAcCodeCarrouselCollection": {
            "items": [
                {
                    "title": "Test HP Product Slider",
                    "acCodes": [
                        {0: "A", 1: "C", 2: "3", "4" ... etc

So it replace array of string into array of objects of splitted strings...

Expected behavior

When a field is declared as acCode: [string], the cache should not alter the type of the response (or cache?).

Environment:

  • OS: Linux AWS / Lambda
  • NodeJS: 20.x
  • @envelop/response-cache versions: 6.2.3
    • @envelop/core: version 5.0.2

Additional context

Roll-backing to @envelop/response-cache like this into my package.json to 6.2.1 solve the issue :

{
  ...
  "overrides": {
    "@envelop/response-cache": "6.2.1"
  },

Thanks for your help,

Regards,
Vitho.

@neurolabs
Copy link

Thanks for the quick release of 6.2.4, fixing this issue.

We were affected by this bug in production. We allowed patch version updates. I would not have expected the causing commit to be released as a patch version, since it is not a backwards compatible bugfix, but IMO a major refactoring. Could you try to implement semantic versioning for future releases?

@CeleroChris
Copy link

CeleroChris commented Oct 10, 2024

Thanks for bringing this up and for the quick release of 6.2.4.

Fortunately, this bug only took down our DEV environment, but it appeared that 6.2.3 is incorrectly parsing DateTime fields in our GraphQL responses (using https://the-guild.dev/graphql/scalars/docs/scalars/date-time) as empty Objects instead of ISO Strings.

Rolling back to 6.2.1 fixed the issue; unfortunately, this issue still persists in 6.2.4.

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

3 participants