Open Bug 2003323 Opened 1 month ago Updated 17 days ago

Saving a json request is not saving the current object

Categories

(DevTools :: JSON Viewer, defect, P2)

Firefox 145
defect

Tracking

(Not tracked)

People

(Reporter: andro.marian.v94, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0

Steps to reproduce:

I request a GET json from:
scheme http
host localhost
filename /json

GET /json HTTP/1.1
Host: 192.168.1.237
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Priority: u=0, i
Pragma: no-cache

Actual results:

Save the file by click on save of press CTRL+S.
The save is like: {"state":{"on":false}}

Change to show the on to true.
On the page is showing the {"state":{"on":true}}
Click on Save and the output on the file is FALSE : {"state":{"on":false}}

Even on the RAW is showing the ON is TRUE, but is saving and old data.

Expected results:

To save the good data, not a cached or what it is.

Attached image image.png

I need to close the Private windows and reopen a new one to save the current data that is showed.

For some reason is stored the first saved object. The windows shows the changed object but when saving it's saving the first stored object.

Component: Untriaged → Netmonitor
Product: Firefox → DevTools

Leo offered to reproduce the bug, thanks!

Flags: needinfo?(lmcardle)

I can reproduce this on Firefox 146:

  • Start https://gist.github.com/LeoMcA/28f19c9c7c3276534afda0b4a355b955 with node index.json which returns a incrementing counter on each load
  • Open a fresh profile in Firefox
  • Load http://localhost:3005/json in Firefox
  • Firefox displays { counter: 0 }
  • Click "Save"
  • Load the saved file, it displays { counter: 1 }
  • Reload http://localhost:3005/json
  • Firefox displays { counter: 2 }
  • Click "Save"
  • Load the saved file, it still displays { counter: 1 }

Every subsequent time saving this page appears to save the originally saved value of { counter: 1 }, even across restarts, new tabs, etc.

Expected result:

At the least, the second save should show { counter: 3 }.

However, ideally, saving the file would show exactly what is in the JSON viewer, and not trigger a fresh fetch.

Flags: needinfo?(lmcardle)

Thanks for the example! Another interesting thing to note, if you disable the jsonviewer via devtools.jsonview.enabled = false in about:config, using save (CmdOrCtrl+S) always seems to save exactly the same as what is displayed in the page (it remains in sync and it doesn't increase just by doing save).

But then if you reenable json viewer and save again, you go back to save again the first version that was ever saved with json viewer.

Severity: -- → S3
Component: Netmonitor → JSON Viewer
Priority: -- → P2

I was able to reproduce this issue on Firefox 146.0.1 using macOS 15 with a fresh profile following the STR from Comment 4. Marking this as NEW.

Status: UNCONFIRMED → NEW
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: