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

separate 'third party provider' feature #252

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Conversation

shakyShane
Copy link
Collaborator

Reviewer: @GioSensation
Asana:

Description

Just moving the code for the 3rd party provider into a separate file - it operates exactly the same but is now no-longer spread across 3 different files.

We should try to avoid growing the size of the base interface in the name of code-share etc. We can apply composition + dependency injection to get the exact same behaviour.

We did this recently with initFormSubmissionsApi and we should continue the trend of having features self-contained - we can still pass in the device and do whatever we need, but it prevents a feature like this from becoming spread across multiple files.

Overview, before

class InterfacePrototype {
    askToUnlockProvider() { /* snip */ }
    providerStatusUpdated() { /* snip */ }
}

class AppleDeviceInterface extends InterfacePrototype {
    async addDeviceListeners () { /* snip */ }
    async _pollForUpdatesToCredentialsProvider () { /* snip */ }
}

class AppleOverlayDeviceInterface extends InterfacePrototype {
    async askToUnlockProvider () { /* snip */ }

    providerStatusUpdated (data) { /* snip */ }
}

Overview, after

export class ThirdPartyProvider {
    constructor(device) { /* snip */ }
    init () { /* snip */ }
    async askToUnlockProvider () { /* snip */ }
    async _pollForUpdatesToCredentialsProvider () { /* snip */ }
    providerStatusUpdated (data) { /* snip */ }
}

Steps to test

@GioSensation This passes all of your existing integration tests (thanks for adding those!) - which makes sense though because all I've done is remove the methods from the interfaces :)

@github-actions
Copy link

Note: Password rules outdated

inntopia.travel not present in current
	rules: minlength: 7; maxlength: 19; required: digit; allowed: upper,lower,[-];

You can update the rules with the following command

cd packages/password && npm run rules:update

Once you've updated the rules, re-run the build from the root with npm run build and then commit all changes.

shakyShane and others added 3 commits March 6, 2024 14:12
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Copy link
Member

@GioSensation GioSensation left a comment

Choose a reason for hiding this comment

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

I finally got around to merging this. Thanks so much for opening it, @shakyShane. I will use it as an example in the docs. 💪

@GioSensation GioSensation merged commit 5afe0f6 into main Mar 6, 2024
1 check passed
@GioSensation GioSensation deleted the shane/feature-based branch March 6, 2024 14:09
CDRussell pushed a commit to duckduckgo/Android that referenced this pull request Mar 18, 2024
Task/Issue URL:
https://app.asana.com/0/1206839421155384/1206839421155384
Autofill Release:
https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/10.2.0


## Description
Updates Autofill to version
[10.2.0](https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/10.2.0).

### Autofill 10.2.0 release notes
## What's Changed
* Remove unused Android UA check by @jonathanKingston in
duckduckgo/duckduckgo-autofill#494
* fix tracker radar kit reference by @brindy in
duckduckgo/duckduckgo-autofill#505
* Update password-related json files (2024-03-04) by @daxmobile in
duckduckgo/duckduckgo-autofill#518
* separate 'third party provider' feature by @shakyShane in
duckduckgo/duckduckgo-autofill#252
* marking flaky tests by @shakyShane in
duckduckgo/duckduckgo-autofill#524
* remove device-specifc 'isEnabled' checks by @shakyShane in
duckduckgo/duckduckgo-autofill#523
* fixing some flaky tests by @shakyShane in
duckduckgo/duckduckgo-autofill#526
* Fixes bugs for Lufthansa, Twitter, Rumble by @GioSensation in
duckduckgo/duckduckgo-autofill#529
* Update Github action dependency by @GioSensation in
duckduckgo/duckduckgo-autofill#531

## New Contributors
* @brindy made their first contribution in
duckduckgo/duckduckgo-autofill#505

**Full Changelog**:
duckduckgo/duckduckgo-autofill@10.1.0...10.2.0

## Steps to test
This release has been tested during autofill development. For smoke test
steps see [this
task](https://app.asana.com/0/1198964220583541/1200583647142330/f).

Co-authored-by: GioSensation <1828326+GioSensation@users.noreply.github.com>
@GioSensation GioSensation mentioned this pull request Apr 9, 2024
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