fossasia / susi_chromebot

SUSI.AI Chrome Extension
GNU Lesser General Public License v2.1
1.54k stars 140 forks source link

Fix Console Error #382, message type Map #366, Persist Susi Reply#402 #403

Closed fragm3 closed 6 years ago

fragm3 commented 6 years ago

Fixes #366, #382, #402

Closed PR https://github.com/fossasia/susi_chromebot/pull/367 due to merge conflicts. The branch was older as the PR was reviewed late.

Checklist

Short description of what this resolves:

screenshot 2018-09-30 at 12 24 41 am screenshot 2018-09-30 at 12 24 51 am screenshot 2018-09-30 at 12 25 35 am

This error comes when you use chrome.storage.sync.set.. to set the data which is more than 8,192 bytes for a single item as chrome.storage.sync.set allows 8,192 QUOTA_BYTES_PER_ITEM.

Using chrome.storage.local.set.. to set the data instead of chrome.storage.sync.set. As chrome.storage.local.set can contains 5242880 :QUOTA_BYTES.

screenshot 2018-09-30 at 12 25 41 am screenshot 2018-09-30 at 12 25 46 am

Content Security Policy does not allow inline javascript. So you have to put your javascript in a .js file and include it in your HTML.

screenshot 2018-09-30 at 12 28 10 am

Susi Response persistent:

Reason for not being persistent: The chrome allows only contains 5242880 byte in chrome.storage.sync.set. Using chrome.storage.local.set. to set the data and get data, solves the in-persistency problem.

Old GIF of bug: bug-response

New: persistent

Changes proposed in this pull request:

fragm3 commented 6 years ago

@zamhaq @ms10398 @gabru-md @rupav Guys please review PR little faster, so that we can add more functionality faster.

ms10398 commented 6 years ago

Thanks @fragm3