Skip to content

Conversation

@malmstein
Copy link
Contributor

@malmstein malmstein commented Apr 1, 2021

Task/Issue URL: https://app.asana.com/0/1157893581871903/1200123654543284

Description:
Background
Change the journal type from write ahead logging to delete.
This means we won't have to close the database hence avoiding all the threading issues.
Estimate: Couple of days
This approach is much faster and solves the main issue at hand, thus the preferred approach

Steps to test this PR:
Download apk from Jenkins https://jenkins.duckduckgo.com/job/android%20-%20duckduckgo%20app%20release/255/

  1. Open app
  2. Get apk contents
  3. Ensure app.db journal file does not exist
  4. Open a tab
  5. Use the Fire button
  6. Download app.db file
  7. Open with a text editor
  8. Check that there is no trace of the previously opened tab

Internal references:

Software Engineering Expectations
Technical Design Template

Copy link
Collaborator

@aitorvs aitorvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Left couple comments of things I think we need to remove:

  • the version 5.80.0
  • the debuggable flag

other than that, I tested and works as expected. Awesome job @malmstein

app/build.gradle Outdated
}
release {
minifyEnabled false
debuggable true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we want to remove this (?)


val CHANGE_JOURNAL_ON_OPEN = object : RoomDatabase.Callback() {
override fun onOpen(db: SupportSQLiteDatabase) {
db.query("PRAGMA journal_mode=DELETE;").use { cursor -> cursor.moveToFirst() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pragma for the win

@@ -1 +1 @@
VERSION=5.79.0 No newline at end of file
VERSION=5.80.0 No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to remove this too

@malmstein malmstein merged commit 7105e5d into develop Apr 2, 2021
@malmstein malmstein deleted the feature/david/journal_mode branch April 2, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants