Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Conversation

@jotaemepereira
Copy link
Collaborator

@jotaemepereira jotaemepereira commented Sep 3, 2023

Task

https://app.asana.com/0/1203581873609357/1205378118665592/f

Description

This adds the following changes:

When inserting/editing a profile

  • When we insert a new profile, we get the list of brokers from the resources list and create the scan operations along with the profile queries.
  • When we edit the profile, we do the same flow but fetch the brokers from the database

Before the scheduler starts running the operations
Here, we check for updates to the broker's list or new ones added. Because this operation could have an impact on performance (it has to go through the JSON files, decode them, and compare them to the database ones) it will run if it didn’t run in the last 24 hours (this constant can be changed)

Steps to test

Scenario 1 - User inserts a new profile

  • Start from scratch (delete Vault.db)
  • Create a new profile
  • Check that scan operations are created for all the broker JSON files (fake ones should not be included)

Scenario 2 - User edits a profile

  • Edit the profile
  • Check that new scan operations are created with the new profile queries and the broker that is in the database (not in resources)

Scenario 3 - There are updates to a broker JSON file

  • Have a profile, run some scans, and then stop the app
  • Delete UserDefaults by running defaults com.duckduckgo.macos.browser.debug
  • Grab one of the broker JSON files and increase the version number
  • Run the app again, the broker JSON file should be updated in the database before running

Scenario 4 - There is a new JSON file

  • Have a profile, run some scans and then stop the app
  • Delete UserDefaults by running defaults com.duckduckgo.macos.browser.debug
  • Create a new broker JSON file
  • Run the app again, the broker JSON file should be updated in the database and the new scan operations should be added

@jotaemepereira jotaemepereira requested a review from Bunn September 3, 2023 14:55
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2023

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 118d3a9

@jotaemepereira jotaemepereira force-pushed the juan/dbp/add-mechanism-to-handle-broker-updates branch from 500db37 to a001df9 Compare September 3, 2023 23:04
Copy link
Collaborator

@Bunn Bunn left a comment

Choose a reason for hiding this comment

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

Nice job, left some comments there, none are blockers, but the dependency injection ones are probably good ones to tackle now, but I'll leave it to you.
Nice job!

@jotaemepereira jotaemepereira force-pushed the juan/dbp/add-mechanism-to-handle-broker-updates branch from a001df9 to 4948676 Compare September 4, 2023 11:59
@jotaemepereira jotaemepereira force-pushed the juan/dbp/add-mechanism-to-handle-broker-updates branch from 4948676 to 118d3a9 Compare September 4, 2023 13:27
@jotaemepereira jotaemepereira merged commit debc232 into develop Sep 4, 2023
@jotaemepereira jotaemepereira deleted the juan/dbp/add-mechanism-to-handle-broker-updates branch September 4, 2023 13:48
samsymons added a commit that referenced this pull request Sep 4, 2023
# By Alexey Martemyanov (5) and others
# Via GitHub (1) and Tomas Strba (1)
* develop:
  DBP Debug UI (#1587)
  Bump version to 1.55.0 (57)
  Update embedded files
  Auto start DBP scheduler (#1586)
  Add broker updater mechanism (#1580)
  Update develop with Bitwarden fix (#1585)
  fix outlook popups loading; set popup window mode to match Safari (#1564)
  remove AppActivityMonitor and related unused code (#1582)
  Popovers positioning (#1574)
  Version 1.54.1
  xcode 15 synthesized color constants fixes (#1583)
  Fixes issue with password saving when using Bitwarden (#1584)
  Remove the incremental test pixel sender (#1578)
  Implement waitlistBetaActive logic (without actually resetting) (#1562)
  Lock Form fill when autofill is locked (#1559)
  show alert when user tries to open file in AppStore version (#1494)
  DBP UI Middleware  (#1553)
  Dashboard & Profile Creation  (#1567)
  roll out the bookmarks bar experiment (#1572)
  Open duck player for youtube same-document navigation (#1560)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/Common/Localizables/UserText.swift
#	DuckDuckGo/NavigationBar/PinningManager.swift
#	DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift
#	DuckDuckGo/Waitlist/NetworkProtectionFeatureVisibility.swift
#	UnitTests/Menus/MoreOptionsMenuTests.swift
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants