Skip to content

Commit

Permalink
Merge branch 'main' into fix-yaml-rust-adviosry
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarik Eshaq committed Nov 2, 2021
2 parents c552956 + 5eea186 commit c7026d8
Show file tree
Hide file tree
Showing 20 changed files with 577 additions and 309 deletions.
2 changes: 1 addition & 1 deletion .buildconfig-android.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryVersion: 86.1.0
libraryVersion: 86.2.0
groupId: org.mozilla.appservices
projects:
autofill:
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# v86.2.0 (_2021-11-02_)

[Full Changelog](https://github.com/mozilla/application-services/compare/v86.1.0...v86.2.0)

## Push
### What's Changed
- We've changed the database schema to avoid confusion about the state of subscriptions and
in particular, avoid `SQL: UNIQUE constraint failed: push_record.channel_id` errors
reported in [#4575](https://github.com/mozilla/application-services/issues/4575). This is
technically a breaking change as a dictionary described in the UDL changed, but in practice,
none of our consumers used it, so we are not declaring it as breaking in this context.

## Logins

### What's New

- Added support for recording telemetry when the logins encryption key needs to be regenerated.

# v86.1.0 (_2021-10-27_)

[Full Changelog](https://github.com/mozilla/application-services/compare/v86.0.0...v86.1.0)
Expand All @@ -24,6 +42,14 @@
See [the Glean Changelog](https://github.com/mozilla/glean/blob/v42.0.1/CHANGELOG.md) for full details.
(Note there is a breaking change in Rust, but that doesn't impact consumers of Application Services)

# v86.0.1 (_2021-10-28_)

[Full Changelog](https://github.com/mozilla/application-services/compare/v86.0.0...v86.0.1)
## Logins
### What's Changed
- Downgraded the log level of some logs, so now they should not show up in Sentry.


# v86.0.0 (_2021-10-13_)

[Full Changelog](https://github.com/mozilla/application-services/compare/v85.4.1...v86.0.0)
Expand All @@ -36,6 +62,15 @@
this change and have PRs in-progress.
([#4549](https://github.com/mozilla/application-services/pull/4549))

# v85.4.2 (_2021-10-20_)

[Full Changelog](https://github.com/mozilla/application-services/compare/v85.4.1...v85.4.2)

## Nimbus
### What's fixed
- Fixed a bug in iOS where the installation date would be set to start of EPOCH ([#4597](https://github.com/mozilla/application-services/pull/4597))


# v85.4.1 (_2021-10-08_)

[Full Changelog](https://github.com/mozilla/application-services/compare/v85.4.0...v85.4.1)
Expand Down
2 changes: 1 addition & 1 deletion CHANGES_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Unreleased Changes

[Full Changelog](https://github.com/mozilla/application-services/compare/v86.1.0...main)
[Full Changelog](https://github.com/mozilla/application-services/compare/v86.2.0...main)

<!-- WARNING: New entries should be added below this comment to ensure the `./automation/prepare-release.py` script works as expected.
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions components/logins/android/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,50 @@
$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

logins_store:
# These track when we need to regenerate the encryption key which causes all
# local data to be lost
key_regenerated_lost:
type: event
description: >
The encryption key was regenerated because it was lost
bugs:
- https://github.com/mozilla/application-services/issues/4554
data_reviews:
- https://github.com/mozilla/application-services/issues/4582
data_sensitivity:
- technical
notification_emails:
- synced-client-integrations@mozilla.com
expires: 2022-04-18

key_regenerated_corrupt:
type: event
description: >
The encryption key was regenerated because it didn't match the encrypted
data
bugs:
- https://github.com/mozilla/application-services/issues/4554
data_reviews:
- https://github.com/mozilla/application-services/issues/4582
data_sensitivity:
- technical
notification_emails:
- synced-client-integrations@mozilla.com
expires: 2022-04-18

key_regenerated_other:
type: event
description: >
The encryption key was regenerated for an unknown reason
bugs:
- https://github.com/mozilla/application-services/issues/4554
data_reviews:
- https://github.com/mozilla/application-services/issues/4582
data_sensitivity:
- technical
notification_emails:
- synced-client-integrations@mozilla.com
expires: 2022-04-18

# These help us understand how much the logins store is being used, and
# whether it's succeeding in the duties asked of it. We'll use them to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@ fun recordMigrationMetrics(jsonString: String) {
}
}

enum class KeyRegenerationEventReason {
Lost, Corrupt, Other,
}

fun recordKeyRegenerationEvent(reason: KeyRegenerationEventReason) {
// Avoid the deprecation warning when calling `record()` without the optional EventExtras param
@Suppress("DEPRECATION")
when (reason) {
KeyRegenerationEventReason.Lost -> LoginsStoreMetrics.keyRegeneratedLost.record()
KeyRegenerationEventReason.Corrupt -> LoginsStoreMetrics.keyRegeneratedCorrupt.record()
KeyRegenerationEventReason.Other -> LoginsStoreMetrics.keyRegeneratedOther.record()
}
}

/**
* A helper class for gathering basic count metrics on different kinds of LoginsStore operation.
*
Expand Down
2 changes: 2 additions & 0 deletions components/push/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ uniffi_build = { version = "^0.14", features=["builtin-bindgen"] }


[dev-dependencies]
env_logger = { version = "0.8", default-features = false, features = ["termcolor", "atty", "humantime"] }
mockito = "0.27"
hex = "0.4"
tempfile = "3.1.0"
viaduct-reqwest = { path = "../support/viaduct-reqwest" }
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ class PushTest {
"1bkHMoiw4b6L7YTyF8foLEEU"

protected fun getPushManager(): PushManager {
return PushManager(
val pm = PushManager(
senderId = mockSenderId,
bridgeType = BridgeType.TEST,
registrationId = "TestRegistrationId",
databasePath = dbFile
)
pm.update("TestRegistrationId")
return pm
}

/* Usage:
Expand Down Expand Up @@ -243,7 +244,6 @@ class PushTest {

manager.subscribe(testChannelid, "foo", vapidPubKey)
val dispatch = manager.dispatchInfoForChid(testChannelid)!!
assertEquals("uaid", "abad1d3a00000000aabbccdd00000000", dispatch.uaid)
assertEquals("scope", "foo", dispatch.scope)
assert(dispatch.endpoint.length > 0)
assertEquals(dispatch.appServerKey, vapidPubKey)
Expand Down
Loading

0 comments on commit c7026d8

Please sign in to comment.