Open eedwardsSGS opened 3 weeks ago
Something else may be going on here. Even if I'm in the master branch, it navigates to the page (in the correct branch, master) then if I click anywhere the page refreshes and it drops all the query params. This only occurs in edit mode, in the deployed version (and all changes have been deployed) this does not happen and everything works fine.
It seems to be related to the newline character '%0A'. appsmith.URL.queryParams.recipient
as far as I understand when I access it that way, Appsmith should have already decoded it and passed it as a string.
On closer examination, it looks like Appsmith's getQueryParamsFromString needs to add newline escape characters replacing:
try {
return JSON.parse(
'{"' +
decodeURI(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"') +
'"}',
);
with this:
try {
return JSON.parse(
'{"' +
decodeURI(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
.replace(/\n/g, '\\n') +
'"}',
);
Or similar.
@eedwardsSGS The query params are not persisted on the url but {{appsmith.URL.queryParams}}
persists the data. Is there any other use case that you are trying ?
https://github.com/user-attachments/assets/c8a7a8be-d8bb-4298-a531-252d6471b55b
@AmanAgarwal041 I'm not seeing a newline character in your example queryparams. That's what is breaking it. See my comments later in the thread.
Is there an existing issue for this?
Description
I am working on a branch other than master in Appsmith. I have a button that fires this function:
When I press it, it navigates to that page but then either immediately changes to the master branch and forgets all the queryParams, or displays the page correctly until I click on anything, at which point it changes to the master branch and forgets all the queryParams.
Steps To Reproduce
Public Sample App
No response
Environment
Production
Severity
Medium (Frustrating UX)
Issue video log
No response
Version
Self Hosted - 1.41