Skip to content

Commit

Permalink
Address initial review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNev committed Mar 8, 2024
1 parent 1fd9c42 commit 6ff737a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .chloggen/device_app_lifecycle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix
change_type: breaking

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: device.app.lifecycle
Expand All @@ -19,4 +19,4 @@ issues: [794]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
subtext: Removes the `ios.lifecycle.events` and `android.lifecycle.events` attributes from the global registry and adds constraints for the possible values of the `android.state` and `ios.state` attributes.

Check failure on line 22 in .chloggen/device_app_lifecycle.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[line-length] line too long (206 > 200 characters)
23 changes: 7 additions & 16 deletions docs/mobile/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ application lifecycle. This event is meant to be used in conjunction with
`os.name` [resource semantic convention](/docs/resource/os.md) to identify the
mobile operating system (e.g. Android, iOS).

Payload attributes MUST be used to describe the state of the application at the
time of the event. The following table describes the payload attributes that MUST
Payload field MUST be used to describe the state of the application at the
time of the event. The following table describes the payload fields that MUST
be used to describe the state of the application at the time of the event.

The `android.state` and `ios.state` attributes are mutually exclusive and MUST
NOT be used together, each attribute MUST be used with it's corresponding
`os.name` [resource semantic convention](/docs/resource/os.md) value. For
example, if the `os.name` attribute is set to `android` then the
`android.state` attribute MUST be used and the `ios.state` attribute MUST NOT
be used. If the `os.name` attribute is set to `ios` then the `ios.state`
attribute MUST be used and the `android.state` attribute MUST NOT be used.
The `android.state` and `ios.state` fields are mutually exclusive and MUST
NOT be used together, each field MUST be used with its corresponding
`os.name` [resource semantic convention](/docs/resource/os.md) value.

### Event details

Expand All @@ -42,18 +38,13 @@ The event name MUST be `device.app.lifecycle`.
<!-- Manually adding the markdown table until the body definition is available in the build tools -->
| Body Field | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `android.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | See below |
| `ios.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [2] | `active` | See below |
| `android.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [1] | `created` | `Conditionally Required`: if and only if `os.name` is `android` |
| `ios.state` | string | This attribute represents the state the application has transitioned into at the occurrence of the event. [2] | `active` | `Conditionally Required`: if and only if `os.name` is `ios` |

**[1]:** The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived.

**[2]:** The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived.

**Additional attribute requirements:** At least one of the following sets of attributes is required:

* `ios.state`
* `android.state`

`android.state` MUST be one of the following:

| Value | Description |
Expand Down
14 changes: 8 additions & 6 deletions model/logs/mobile-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ groups:
brief: >
This event represents an occurrence of a lifecycle transition on Android or iOS platform.
note: >
This events identifies the fields that are common to all lifecycle events for android and iOS using
the `android.state` and `ios.state` attributes. The `android.state` and `ios.state` attributes are
This event identifies the fields that are common to all lifecycle events for android and iOS using
the `android.state` and `ios.state` fields. The `android.state` and `ios.state` attributes are
mutually exclusive.
# Future Note: When the build tools support this definition please uncomment and validate the details
# included here and what has been added to the manual markdown table
# body:
# fields:
# - id: ios.state
# stability: experimental
# requirement_level:
# conditional_required: if and only if `os.name` is `ios`
# note: >
# The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902),
# and from which the `OS terminology` column values are derived.
Expand Down Expand Up @@ -46,6 +50,8 @@ groups:
# The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.
# - id: android.state
# stability: experimental
# requirement_level:
# conditional_required: if and only if `os.name` is `android`
# brief: >
# This attribute represents the state the application has transitioned into at the occurrence of the event.
# note: >
Expand All @@ -69,7 +75,3 @@ groups:
# brief: >
# Any time after Activity.onResume() or, if the app has no Activity,
# Context.startService() has been called when the app was in either the created or background states.
# constraints:
# - any_of:
# - "ios.state"
# - "android.state"

0 comments on commit 6ff737a

Please sign in to comment.