Modify

Opened 3 years ago

Last modified 3 months ago

#11474 new enhancement

Update DataSaverPlugin to use browser localStorage when possible.

Reported by: Tiago Teresa Teodósio Owned by:
Priority: normal Component: DataSaverPlugin
Severity: normal Keywords: javascript
Cc: Trac Release:

Description

As there is a 4KB limit on the cookie size, larger form data can't be saved. I propose the usage of browser localStorage when possible.

There is a proposed implementation attached, based on datasaverplugin/trunk/datasaver/htdocs/datasaver.js?rev=8703

Attachments (2)

datasaver.js (4.9 KB) - added by Tiago Teresa Teodósio 3 years ago.
js_bug_fix.diff (414 bytes) - added by Tiago Teresa Teodósio 3 years ago.

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by Tiago Teresa Teodósio

Attachment: datasaver.js added

comment:1 Changed 3 years ago by Steffen Hoffmann

Keywords: javascript added
Status: newaccepted

Tested with nearly 600000 chars, just works.

Even if we did not yet enforce an explicit declaration of consent I do assume, that you're ok with including your code into the GPL'ed source of this plugin, right?

comment:2 Changed 3 years ago by Tiago Teresa Teodósio

Yes, my code is given to the public under the same license of the original code.

comment:3 Changed 3 years ago by Steffen Hoffmann

In 13550:

DataSaverPlugin: Break the 4 kB storage limit for browser cookies, refs #11474.

Thanks to TiagoTT the JavaScript code uses localStorage now, what is great!

Changed 3 years ago by Tiago Teresa Teodósio

Attachment: js_bug_fix.diff added

comment:4 Changed 3 years ago by Tiago Teresa Teodósio

I am very sorry, but I realized there is an error on the JavaScript code, which however did not prevent it from working as expected.

I attached the patch with the fix.

This is how the patch was produced, on the repository root:

svn diff > js_bug_fix.diff

Again I am sorry for the trouble.

comment:5 Changed 3 years ago by Steffen Hoffmann

In 13560:

DataSaverPlugin: Correct new JavaScript function name, refs #11474.

comment:6 in reply to:  4 Changed 3 years ago by Steffen Hoffmann

Replying to TiagoTT:

I am very sorry, but I realized there is an error on the JavaScript code, ...

Hey, thanks for the notice. I've looked through, but not checked the code that thoroughly myself, so this is partially my fault too. Really interesting, that it doesn't bail out, but I bet, that a look at firebug console would have told me about it.

Anyway, I've quickly applied the fix, so not much harm done for now.

Again I am sorry for the trouble.

Na, don't worry. Bugs lure on the way to improvements, but without a change there isn't a chance for improvements at all. I'm still glad you brought the issue up.

comment:7 Changed 3 months ago by Ryan J Ollos

Status: acceptednew

comment:8 Changed 3 months ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

Modify Ticket

Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.