Skip to content

interceptors.cache is not aware of query? #4209

@olessavluk

Description

@olessavluk

Bug Description

Request with different query parameters getting cached/matched as same

Reproducible By

https://gist.github.com/olessavluk/3a2b362ac83d38446f8d1c574f337ddf

Expected Behavior

Each request should be fetched&cached independently

Logs & Screenshots

Details

output using query (incorrect):

{
  url: '/?i=0',
  duration: 0.11615504099999999,
  response: '2025-05-12T16:52:41.504Z'
}
{
  url: '/?i=1',
  duration: 0.102368958,
  response: '2025-05-12T16:52:41.613Z'
}
{
  url: '/?i=2',
  duration: 0.0006754169999999818,
  response: '2025-05-12T16:52:41.504Z'
}
{
  url: '/?i=3',
  duration: 0.00030879199999998266,
  response: '2025-05-12T16:52:41.613Z'
}
{
  url: '/?i=4',
  duration: 0.00023441600000001018,
  response: '2025-05-12T16:52:41.504Z'
}
{
  url: '/?i=5',
  duration: 0.00020495899999997393,
  response: '2025-05-12T16:52:41.613Z'
}
{
  url: '/?i=6',
  duration: 0.00033770800000002053,
  response: '2025-05-12T16:52:41.504Z'
}
{
  url: '/?i=7',
  duration: 0.00040424999999999045,
  response: '2025-05-12T16:52:41.613Z'
}
{
  url: '/?i=8',
  duration: 0.00039845799999994826,
  response: '2025-05-12T16:52:41.504Z'
}
{
  url: '/?i=9',
  duration: 0.0002994169999999485,
  response: '2025-05-12T16:52:41.613Z'
}
{
  url: '/?i=10',
  duration: 0.00024383399999999256,
  response: '2025-05-12T16:52:41.504Z'
}
Uniq responses 2 Set(2) { '2025-05-12T16:52:41.504Z', '2025-05-12T16:52:41.613Z' }

output when using path: ?i=${i}, (correct):

{
  url: '/?i=0',
  duration: 0.11623329199999999,
  response: '2025-05-12T16:55:02.215Z'
}
{
  url: '/?i=1',
  duration: 0.10322800000000004,
  response: '2025-05-12T16:55:02.324Z'
}
{
  url: '/?i=2',
  duration: 0.10129141599999997,
  response: '2025-05-12T16:55:02.426Z'
}
{
  url: '/?i=3',
  duration: 0.10466695800000002,
  response: '2025-05-12T16:55:02.528Z'
}
{
  url: '/?i=4',
  duration: 0.10547295800000006,
  response: '2025-05-12T16:55:02.635Z'
}
{
  url: '/?i=5',
  duration: 0.10417241699999999,
  response: '2025-05-12T16:55:02.740Z'
}
{
  url: '/?i=6',
  duration: 0.10392204200000003,
  response: '2025-05-12T16:55:02.845Z'
}
{
  url: '/?i=7',
  duration: 0.10278116699999998,
  response: '2025-05-12T16:55:02.948Z'
}
{
  url: '/?i=8',
  duration: 0.10540300000000002,
  response: '2025-05-12T16:55:03.052Z'
}
{
  url: '/?i=9',
  duration: 0.10356150000000003,
  response: '2025-05-12T16:55:03.158Z'
}
{
  url: '/?i=10',
  duration: 0.10319604200000003,
  response: '2025-05-12T16:55:03.262Z'
}
Uniq responses 11 Set(11) {
  '2025-05-12T16:55:02.215Z',
  '2025-05-12T16:55:02.324Z',
  '2025-05-12T16:55:02.426Z',
  '2025-05-12T16:55:02.528Z',
  '2025-05-12T16:55:02.635Z',
  '2025-05-12T16:55:02.740Z',
  '2025-05-12T16:55:02.845Z',
  '2025-05-12T16:55:02.948Z',
  '2025-05-12T16:55:03.052Z',
  '2025-05-12T16:55:03.158Z',
  '2025-05-12T16:55:03.262Z'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions