Modify

Opened 9 months ago

Last modified 9 months ago

#11474 accepted enhancement

Update DataSaverPlugin to use browser localStorage when possible.

Reported by: TiagoTT Owned by: hasienda
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 TiagoTT 9 months ago.
js_bug_fix.diff (414 bytes) - added by TiagoTT 9 months ago.

Download all attachments as: .zip

Change History (8)

Changed 9 months ago by TiagoTT

comment:1 Changed 9 months ago by hasienda

  • Keywords javascript added
  • Status changed from new to accepted

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 9 months ago by TiagoTT

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

comment:3 Changed 9 months ago by hasienda

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 9 months ago by TiagoTT

comment:4 follow-up: Changed 9 months ago by TiagoTT

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 9 months ago by hasienda

In 13560:

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

comment:6 in reply to: ↑ 4 Changed 9 months ago by hasienda

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.

Add Comment

Modify Ticket

Action
as accepted .
Author


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

 
Note: See TracTickets for help on using tickets.