Modify

Opened 10 years ago

Closed 5 years ago

Last modified 5 years ago

#11474 closed enhancement (fixed)

Update DataSaverPlugin to use browser localStorage when possible.

Reported by: Tiago Teresa Teodósio Owned by: Tiago Teresa Teodósio
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 10 years ago.
js_bug_fix.diff (414 bytes) - added by Tiago Teresa Teodósio 10 years ago.

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by Tiago Teresa Teodósio

Attachment: datasaver.js added

comment:1 Changed 10 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 10 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 10 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 10 years ago by Tiago Teresa Teodósio

Attachment: js_bug_fix.diff added

comment:4 Changed 10 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 10 years ago by Steffen Hoffmann

In 13560:

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

comment:6 in reply to:  4 Changed 10 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 7 years ago by Ryan J Ollos

Status: acceptednew

comment:8 Changed 7 years ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

comment:9 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

comment:10 Changed 5 years ago by Ryan J Ollos

Owner: set to Tiago Teresa Teodósio

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Tiago Teresa Teodósio.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.