Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear history entries from memory and database when clicking fire button #4450

Conversation

CrisBarreiro
Copy link
Contributor

@CrisBarreiro CrisBarreiro commented Apr 23, 2024

Task/Issue URL: https://app.asana.com/0/1205008441501016/1206832755470649/f

Description

See title

Steps to test this PR

Feature 1

  • Visit wikipedia.org
  • Type wiki
  • Check wikipedia.org shows as a history suggestion
  • Press fire button
  • Type wiki again
  • Check wikipedia.org isn't shown as a history suggestion anymore

Copy link
Contributor Author

CrisBarreiro commented Apr 23, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @CrisBarreiro and the rest of your teammates on Graphite Graphite

@CrisBarreiro CrisBarreiro changed the title Clear history elements older than 30 days Clear history entries from memory and database when clicking fire button Apr 23, 2024
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 172b303 to c391a17 Compare April 23, 2024 13:07
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from 3e52f95 to 8a65e96 Compare April 24, 2024 11:47
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from c391a17 to 5ad8558 Compare April 24, 2024 11:47
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from 8a65e96 to b8dbb92 Compare April 25, 2024 11:34
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 5ad8558 to 17efc3b Compare April 25, 2024 11:35
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from b8dbb92 to ff1d23d Compare April 25, 2024 11:35
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch 2 times, most recently from 34610cf to 1179474 Compare April 25, 2024 11:48
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from ff1d23d to 5c6c1f9 Compare April 25, 2024 14:35
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 1179474 to 137874e Compare April 25, 2024 14:35
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from 5c6c1f9 to dba53d9 Compare April 25, 2024 15:01
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 137874e to 28eed47 Compare April 25, 2024 15:01
@CrisBarreiro CrisBarreiro marked this pull request as ready for review April 25, 2024 15:07
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from dba53d9 to e9a67c9 Compare April 29, 2024 12:36
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 28eed47 to f43ecc1 Compare April 29, 2024 12:36
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/defer-local-results branch from e9a67c9 to 0d2bfa3 Compare April 29, 2024 14:30
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 5a21ae9 to 67be27a Compare May 2, 2024 09:16
@CrisBarreiro CrisBarreiro mentioned this pull request May 2, 2024
16 tasks
@@ -42,4 +42,8 @@ class RealNavigationHistory @Inject constructor(
override fun getHistorySingle(): Single<List<HistoryEntry>> {
return historyRepository.getHistoryObservable()
}

override suspend fun clearHistory() {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: if we make it suspend, it's best if we enforce dispatcher here. Just adding withContext(dispatcher.io())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No strong opinions, but why here and not on the repository?

@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/history-entry branch from cb0235c to c2caede Compare May 15, 2024 14:08
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch 2 times, most recently from 8a2b4ad to e8d4f44 Compare May 15, 2024 15:52
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/history-entry branch from 34f2ced to 38500c8 Compare May 16, 2024 10:16
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from e8d4f44 to 6831b27 Compare May 16, 2024 10:16
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 6831b27 to 6c0af8e Compare May 22, 2024 08:45
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/history-entry branch from 42974d1 to cdc35c9 Compare May 22, 2024 09:12
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 6c0af8e to 615f20b Compare May 22, 2024 09:12
@CrisBarreiro CrisBarreiro mentioned this pull request May 22, 2024
3 tasks
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 615f20b to 3c1ac6e Compare May 22, 2024 14:22
@CrisBarreiro CrisBarreiro changed the base branch from feature/cbarreiro/autocomplete/history-entry to feature/cbarreiro/autocomplete/allow-bookmarks-in-top-hits May 22, 2024 14:22
Base automatically changed from feature/cbarreiro/autocomplete/allow-bookmarks-in-top-hits to feature/cbarreiro/autocomplete/history-entry May 22, 2024 14:23
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/history-entry branch from 39db003 to 9ce7fa6 Compare May 27, 2024 08:10
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 3c1ac6e to 9648c7f Compare May 27, 2024 08:10
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/history-entry branch from 9ce7fa6 to b57edfa Compare May 27, 2024 10:00
@CrisBarreiro CrisBarreiro force-pushed the feature/cbarreiro/autocomplete/clear-on-fire-button branch from 9648c7f to dad2991 Compare May 27, 2024 10:00
Task/Issue URL: https://app.asana.com/0/0/1206969865711357/f 

### Description
See title

### Steps to test this PR

Checkout this branch, go to HistoryDeletionWorker, and modify
scheduleWorker adding setInitialDelay(5, TimeUnit.Minutes). Clear app
data afterwards

_Feature 1_
- Checkout this branch, go to `HistoryDeletionWorker`, and modify
`scheduleWorker` adding `setInitialDelay(5, TimeUnit.Minutes)`
- [ ] Go to `RealNavigationHistory` and modify
`historyRepository.clearEntriesOlderThan(currentTimeProvider.localDateTimeNow().minusDays(30))`,
changing `minusDays(30)` to `minusMinutes (2)`
- [ ] Add a log so you know deletion is happening
- [ ] Do a fresh install
- [ ] Open app
- [ ] Browse normally for a few minutes
- [ ] Check that after ~5 minutes the log is shown and items older than
2 minutes are removed. Note that, if a site has several visits and some
of them are more recent than the threshold for removal, only old visits
will be removed, but both the entry entity and the recent visits will
remain

### UI changes
N/A
@CrisBarreiro CrisBarreiro merged commit f09e64b into feature/cbarreiro/autocomplete/history-entry May 29, 2024
4 checks passed
@CrisBarreiro CrisBarreiro deleted the feature/cbarreiro/autocomplete/clear-on-fire-button branch May 29, 2024 10:41
cmonfortep pushed a commit that referenced this pull request May 30, 2024
…ton (#4450)

Task/Issue URL:
https://app.asana.com/0/1205008441501016/1206832755470649/f

### Description
See title

### Steps to test this PR

_Feature 1_
- [ ] Visit wikipedia.org
- [ ] Type wiki
- [ ] Check wikipedia.org shows as a history suggestion
- [ ] Press fire button
- [ ] Type wiki again
- [ ] Check wikipedia.org isn't shown as a history suggestion anymore
CrisBarreiro added a commit that referenced this pull request May 31, 2024
…ton (#4450)

Task/Issue URL:
https://app.asana.com/0/1205008441501016/1206832755470649/f

### Description
See title

### Steps to test this PR

_Feature 1_
- [ ] Visit wikipedia.org
- [ ] Type wiki
- [ ] Check wikipedia.org shows as a history suggestion
- [ ] Press fire button
- [ ] Type wiki again
- [ ] Check wikipedia.org isn't shown as a history suggestion anymore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants