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

DBP API changes for WebUI #2146

Closed
wants to merge 34 commits into from
Closed

DBP API changes for WebUI #2146

wants to merge 34 commits into from

Conversation

Bunn
Copy link
Collaborator

@Bunn Bunn commented Feb 2, 2024

Task/Issue URL: https://app.asana.com/0/1204167627774280/1206480273655878/f

Description:
Add url property to data broker model, and changes result for WebUI call to support new UI designs

Steps to test this PR:
The most important thing to test is the database migration.

  1. Open the app with the main branch, create a profile and do the scans
  2. Open this PR and check if your information is still there and that all brokers have an url and name property
  3. You might want to return nil here to force the JSON updates
  4. Test the new web UI https://use-devtesting4.duckduckgo.com/

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Feb 2, 2024
Copy link
Contributor

github-actions bot commented Feb 2, 2024

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

Generated by 🚫 dangerJS against df6a2b1

@github-actions github-actions bot removed the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Feb 2, 2024
Copy link
Collaborator

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

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

It is looking good 👍🏼 . I’ve added some comments. The most pressing one is the unique on the new url column

do {
if try database.tableExists(BrokerDB.databaseTableName) {
try database.alter(table: BrokerDB.databaseTableName) {
$0.add(column: BrokerDB.Columns.url.name, .text)
Copy link
Collaborator

@jotaemepereira jotaemepereira Feb 5, 2024

Choose a reason for hiding this comment

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

⚠️ This should be: $0.add(column: BrokerDB.Columns.url.name, .text).unique()

I have another question: should we remove the uniqueness from the name column? Is it possible for two brokers to have the same name but different URLs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not an easy way to do this without some bigger changes. It's probably possible to create a tmp table, move things there, drop the current one and re-create with the unique property but I don't think it's worth the effort now.

https://www.sqlite.org/lang_altertable.html
The column may not have a PRIMARY KEY or UNIQUE constraint.

@Bunn Bunn requested a review from jotaemepereira February 5, 2024 18:50
Copy link
Collaborator

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

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

Looks great 🎉 !!!

Bunn added a commit that referenced this pull request Feb 21, 2024
Cherry picked from #2146
Task/Issue URL:
https://app.asana.com/0/1204167627774280/1206480273655878/f

**Description**:
Add url property to data broker model, and changes result for WebUI call
to support new UI designs
@Bunn
Copy link
Collaborator Author

Bunn commented Feb 22, 2024

Closed in favor of #2233

@Bunn Bunn closed this Feb 22, 2024
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