e-mission / cordova-usercache Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
We expect to keep timeline data for the past 7 days. But on experimentation, I see that documents are never deleted. If I load data from a year ago, it still reads from the cache. This is probably why the app's data size is so large.
This code
private void updateReadTimestamp(int keyRes) {
SQLiteDatabase writeDb = this.getWritableDatabase();
ContentValues updateValues = new ContentValues();
updateValues.put(KEY_READ_TS, ((double)System.currentTimeMillis())/1000);
updateValues.put(KEY_KEY, getKey(keyRes));
writeDb.update(TABLE_USER_CACHE, updateValues, null, null);
writeDb.close();
}
sets the key for all entries in the database to the key of the read document.
According to the logs, this is the query that is executed.
03-29 02:30:28.178 11699-11723/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Clearing obsolete RW-DOCUMENTS using DELETE FROM userCache WHERE write_ts IN (SELECT B.write_ts FROM userCache A JOIN userCache B on B.key == A.key WHERE (B.type == 'rw-document' AND A.type == 'document' AND A.write_ts > B.write_ts))
If I run the query manually, against a downloaded database, it works. But it doesn't work seem to work against the actual database. This is not actually a huge tragedy, and we have a lot of work to do today morning, so let's just punt for now.
39976,1456440668.991,ERROR,"ServerSyncAdapter : Error org.json.JSONException: Value app launched of type java.lang.String cannot be converted to JSONObject while saving converting trips to JSON, skipping all of them"
While investigating documents created directly from javascript today, I discovered that iOS doesn't fill in metadata timezone information, at least for for rw documents. And since the metadata is consistent, it probably doesn't fill in the information for any documents.
We do workaround this by setting the timezone to America/Los_Angeles
if it is not present, but that's incorrect for locations other than the west coast of the US. We should either stop using the metadata timezone, or fill it in correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.