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

Revert usage of stable fields in live location sharing and polls #7752

Merged
merged 2 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7751.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert usage of stable fields in live location sharing and polls
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class DefaultStartLiveLocationShareTask @Inject constructor(
isLive = true,
unstableTimestampMillis = clock.epochMillis()
).toContent()
val eventType = EventType.STATE_ROOM_BEACON_INFO.stable
val eventType = EventType.STATE_ROOM_BEACON_INFO.unstable
val sendStateTaskParams = SendStateTask.Params(
roomId = params.roomId,
stateKey = userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal class DefaultStopLiveLocationShareTask @Inject constructor(
val sendStateTaskParams = SendStateTask.Params(
roomId = params.roomId,
stateKey = stateKey,
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
body = updatedContent
)
return try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ internal class LocalEchoEventFactory @Inject constructor(
originServerTs = dummyOriginServerTs(),
senderId = userId,
eventId = localId,
type = EventType.POLL_START.stable,
type = EventType.POLL_START.unstable,
content = newContent.toContent().plus(additionalContent.orEmpty())
)
}
Expand All @@ -206,7 +206,7 @@ internal class LocalEchoEventFactory @Inject constructor(
originServerTs = dummyOriginServerTs(),
senderId = userId,
eventId = localId,
type = EventType.POLL_RESPONSE.stable,
type = EventType.POLL_RESPONSE.unstable,
content = content.toContent().plus(additionalContent.orEmpty()),
unsignedData = UnsignedData(age = null, transactionId = localId)
)
Expand All @@ -226,7 +226,7 @@ internal class LocalEchoEventFactory @Inject constructor(
originServerTs = dummyOriginServerTs(),
senderId = userId,
eventId = localId,
type = EventType.POLL_START.stable,
type = EventType.POLL_START.unstable,
content = content.toContent().plus(additionalContent.orEmpty()),
unsignedData = UnsignedData(age = null, transactionId = localId)
)
Expand All @@ -249,7 +249,7 @@ internal class LocalEchoEventFactory @Inject constructor(
originServerTs = dummyOriginServerTs(),
senderId = userId,
eventId = localId,
type = EventType.POLL_END.stable,
type = EventType.POLL_END.unstable,
content = content.toContent().plus(additionalContent.orEmpty()),
unsignedData = UnsignedData(age = null, transactionId = localId)
)
Expand Down Expand Up @@ -300,7 +300,7 @@ internal class LocalEchoEventFactory @Inject constructor(
originServerTs = dummyOriginServerTs(),
senderId = userId,
eventId = localId,
type = EventType.BEACON_LOCATION_DATA.stable,
type = EventType.BEACON_LOCATION_DATA.unstable,
content = content.toContent().plus(additionalContent.orEmpty()),
unsignedData = UnsignedData(age = null, transactionId = localId)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ object PollEventsTestData {
)

internal val A_POLL_START_EVENT = Event(
type = EventType.POLL_START.stable,
type = EventType.POLL_START.unstable,
eventId = AN_EVENT_ID,
originServerTs = 1652435922563,
senderId = A_USER_ID_1,
Expand All @@ -96,7 +96,7 @@ object PollEventsTestData {
)

internal val A_POLL_RESPONSE_EVENT = Event(
type = EventType.POLL_RESPONSE.stable,
type = EventType.POLL_RESPONSE.unstable,
eventId = AN_EVENT_ID,
originServerTs = 1652435922563,
senderId = A_USER_ID_1,
Expand All @@ -105,7 +105,7 @@ object PollEventsTestData {
)

internal val A_POLL_END_EVENT = Event(
type = EventType.POLL_END.stable,
type = EventType.POLL_END.unstable,
eventId = AN_EVENT_ID,
originServerTs = 1652435922563,
senderId = A_USER_ID_1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DefaultGetActiveBeaconInfoForUserTaskTest {
result shouldBeEqualTo currentStateEvent
fakeStateEventDataSource.verifyGetStateEvent(
roomId = params.roomId,
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
stateKey = QueryStringValue.Equals(A_USER_ID)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internal class DefaultStartLiveLocationShareTaskTest {
val expectedParams = SendStateTask.Params(
roomId = params.roomId,
stateKey = A_USER_ID,
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
body = expectedBeaconContent
)
fakeSendStateTask.verifyExecuteRetry(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class DefaultStopLiveLocationShareTaskTest {
val expectedSendParams = SendStateTask.Params(
roomId = params.roomId,
stateKey = A_USER_ID,
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
body = expectedBeaconContent
)
fakeSendStateTask.verifyExecuteRetry(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class LiveLocationShareRedactionEventProcessorTest {
@Test
fun `given a redacted live location share event when processing it then related summaries are deleted from database`() = runTest {
val event = Event(eventId = AN_EVENT_ID, redacts = A_REDACTED_EVENT_ID)
val redactedEventEntity = EventEntity(eventId = A_REDACTED_EVENT_ID, type = EventType.STATE_ROOM_BEACON_INFO.stable)
val redactedEventEntity = EventEntity(eventId = A_REDACTED_EVENT_ID, type = EventType.STATE_ROOM_BEACON_INFO.unstable)
fakeRealm.givenWhere<EventEntity>()
.givenEqualTo(EventEntityFields.EVENT_ID, A_REDACTED_EVENT_ID)
.givenFindFirst(redactedEventEntity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object FakeCreatePollViewStates {
)

private val A_POLL_START_EVENT = Event(
type = EventType.POLL_START.stable,
type = EventType.POLL_START.unstable,
eventId = A_FAKE_EVENT_ID,
originServerTs = 1652435922563,
senderId = A_FAKE_USER_ID,
Expand Down