Skip to content

[remote functions] remote query hash key is not stable for object keys in different orders. #15551

@jaycejonestrinityonline

Description

Describe the bug

getFoo({ foo: 1, bar:2 }) and getFoo({ bar:2, foo: 1 }) do no produce the same hash leading to additional request being made or stale data in the case of getFoo(...).refresh().

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-vixwlscz?file=src%2Froutes%2F%2Bpage.svelte

on index page, notice demoQuery is loaded twice. click "click me" and notice only 1 remote query is refreshed

Logs

N/A

System Info

System:
    OS: Linux 6.6 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900
    Memory: 21.93 GB / 31.19 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.18.0 - /home/jayce/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - /home/jayce/.nvm/versions/node/v20.18.0/bin/npm
    pnpm: 10.18.0 - /home/jayce/.local/share/pnpm/pnpm
    bun: 1.1.15 - /mnt/c/Users/jjones/AppData/Roaming/npm/bun

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions