Skip to content

Commit dba8aae

Browse files
authored
Merge pull request #7752 from vector-im/fix/mna/wrong-usage-of-stable-fields
Revert usage of stable fields in live location sharing and polls
2 parents a762179 + 99942c2 commit dba8aae

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

changelog.d/7751.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Revert usage of stable fields in live location sharing and polls

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/location/StartLiveLocationShareTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal class DefaultStartLiveLocationShareTask @Inject constructor(
4646
isLive = true,
4747
unstableTimestampMillis = clock.epochMillis()
4848
).toContent()
49-
val eventType = EventType.STATE_ROOM_BEACON_INFO.stable
49+
val eventType = EventType.STATE_ROOM_BEACON_INFO.unstable
5050
val sendStateTaskParams = SendStateTask.Params(
5151
roomId = params.roomId,
5252
stateKey = userId,

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/location/StopLiveLocationShareTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ internal class DefaultStopLiveLocationShareTask @Inject constructor(
4545
val sendStateTaskParams = SendStateTask.Params(
4646
roomId = params.roomId,
4747
stateKey = stateKey,
48-
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
48+
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
4949
body = updatedContent
5050
)
5151
return try {

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ internal class LocalEchoEventFactory @Inject constructor(
181181
originServerTs = dummyOriginServerTs(),
182182
senderId = userId,
183183
eventId = localId,
184-
type = EventType.POLL_START.stable,
184+
type = EventType.POLL_START.unstable,
185185
content = newContent.toContent().plus(additionalContent.orEmpty())
186186
)
187187
}
@@ -206,7 +206,7 @@ internal class LocalEchoEventFactory @Inject constructor(
206206
originServerTs = dummyOriginServerTs(),
207207
senderId = userId,
208208
eventId = localId,
209-
type = EventType.POLL_RESPONSE.stable,
209+
type = EventType.POLL_RESPONSE.unstable,
210210
content = content.toContent().plus(additionalContent.orEmpty()),
211211
unsignedData = UnsignedData(age = null, transactionId = localId)
212212
)
@@ -226,7 +226,7 @@ internal class LocalEchoEventFactory @Inject constructor(
226226
originServerTs = dummyOriginServerTs(),
227227
senderId = userId,
228228
eventId = localId,
229-
type = EventType.POLL_START.stable,
229+
type = EventType.POLL_START.unstable,
230230
content = content.toContent().plus(additionalContent.orEmpty()),
231231
unsignedData = UnsignedData(age = null, transactionId = localId)
232232
)
@@ -249,7 +249,7 @@ internal class LocalEchoEventFactory @Inject constructor(
249249
originServerTs = dummyOriginServerTs(),
250250
senderId = userId,
251251
eventId = localId,
252-
type = EventType.POLL_END.stable,
252+
type = EventType.POLL_END.unstable,
253253
content = content.toContent().plus(additionalContent.orEmpty()),
254254
unsignedData = UnsignedData(age = null, transactionId = localId)
255255
)
@@ -300,7 +300,7 @@ internal class LocalEchoEventFactory @Inject constructor(
300300
originServerTs = dummyOriginServerTs(),
301301
senderId = userId,
302302
eventId = localId,
303-
type = EventType.BEACON_LOCATION_DATA.stable,
303+
type = EventType.BEACON_LOCATION_DATA.unstable,
304304
content = content.toContent().plus(additionalContent.orEmpty()),
305305
unsignedData = UnsignedData(age = null, transactionId = localId)
306306
)

matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/session/room/aggregation/poll/PollEventsTestData.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ object PollEventsTestData {
8787
)
8888

8989
internal val A_POLL_START_EVENT = Event(
90-
type = EventType.POLL_START.stable,
90+
type = EventType.POLL_START.unstable,
9191
eventId = AN_EVENT_ID,
9292
originServerTs = 1652435922563,
9393
senderId = A_USER_ID_1,
@@ -96,7 +96,7 @@ object PollEventsTestData {
9696
)
9797

9898
internal val A_POLL_RESPONSE_EVENT = Event(
99-
type = EventType.POLL_RESPONSE.stable,
99+
type = EventType.POLL_RESPONSE.unstable,
100100
eventId = AN_EVENT_ID,
101101
originServerTs = 1652435922563,
102102
senderId = A_USER_ID_1,
@@ -105,7 +105,7 @@ object PollEventsTestData {
105105
)
106106

107107
internal val A_POLL_END_EVENT = Event(
108-
type = EventType.POLL_END.stable,
108+
type = EventType.POLL_END.unstable,
109109
eventId = AN_EVENT_ID,
110110
originServerTs = 1652435922563,
111111
senderId = A_USER_ID_1,

matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/session/room/location/DefaultGetActiveBeaconInfoForUserTaskTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class DefaultGetActiveBeaconInfoForUserTaskTest {
6969
result shouldBeEqualTo currentStateEvent
7070
fakeStateEventDataSource.verifyGetStateEvent(
7171
roomId = params.roomId,
72-
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
72+
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
7373
stateKey = QueryStringValue.Equals(A_USER_ID)
7474
)
7575
}

matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/session/room/location/DefaultStartLiveLocationShareTaskTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ internal class DefaultStartLiveLocationShareTaskTest {
7575
val expectedParams = SendStateTask.Params(
7676
roomId = params.roomId,
7777
stateKey = A_USER_ID,
78-
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
78+
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
7979
body = expectedBeaconContent
8080
)
8181
fakeSendStateTask.verifyExecuteRetry(

matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/session/room/location/DefaultStopLiveLocationShareTaskTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class DefaultStopLiveLocationShareTaskTest {
7979
val expectedSendParams = SendStateTask.Params(
8080
roomId = params.roomId,
8181
stateKey = A_USER_ID,
82-
eventType = EventType.STATE_ROOM_BEACON_INFO.stable,
82+
eventType = EventType.STATE_ROOM_BEACON_INFO.unstable,
8383
body = expectedBeaconContent
8484
)
8585
fakeSendStateTask.verifyExecuteRetry(

matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/session/room/location/LiveLocationShareRedactionEventProcessorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class LiveLocationShareRedactionEventProcessorTest {
7979
@Test
8080
fun `given a redacted live location share event when processing it then related summaries are deleted from database`() = runTest {
8181
val event = Event(eventId = AN_EVENT_ID, redacts = A_REDACTED_EVENT_ID)
82-
val redactedEventEntity = EventEntity(eventId = A_REDACTED_EVENT_ID, type = EventType.STATE_ROOM_BEACON_INFO.stable)
82+
val redactedEventEntity = EventEntity(eventId = A_REDACTED_EVENT_ID, type = EventType.STATE_ROOM_BEACON_INFO.unstable)
8383
fakeRealm.givenWhere<EventEntity>()
8484
.givenEqualTo(EventEntityFields.EVENT_ID, A_REDACTED_EVENT_ID)
8585
.givenFindFirst(redactedEventEntity)

vector/src/test/java/im/vector/app/test/fakes/FakeCreatePollViewStates.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ object FakeCreatePollViewStates {
6363
)
6464

6565
private val A_POLL_START_EVENT = Event(
66-
type = EventType.POLL_START.stable,
66+
type = EventType.POLL_START.unstable,
6767
eventId = A_FAKE_EVENT_ID,
6868
originServerTs = 1652435922563,
6969
senderId = A_FAKE_USER_ID,

0 commit comments

Comments
 (0)