Skip to content

Commit 3728c0a

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/add-slack-notification-when-ci-cd-fails
2 parents 1db5949 + ffd6f92 commit 3728c0a

177 files changed

Lines changed: 1859 additions & 1405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.ci.cd.workflow.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
with:
129129
customParameters: -streamBase64TestDataSet "${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}" -testDataSetIndex ${{ env.SEQUENTIAL_INDEX }}
130130
customImage: ${{ env.DOCKER_TAG }}
131-
timeout-minutes: 20
131+
timeout-minutes: 40
132132
continue-on-error: true
133133

134134
- name: Run Tests (Attempt 2)
@@ -142,7 +142,7 @@ jobs:
142142
with:
143143
customParameters: -streamBase64TestDataSet "${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}" -testDataSetIndex ${{ env.SEQUENTIAL_INDEX }}
144144
customImage: ${{ env.DOCKER_TAG }}
145-
timeout-minutes: 20
145+
timeout-minutes: 50
146146
continue-on-error: true
147147

148148
- name: Run Tests (Attempt 3)
@@ -156,7 +156,7 @@ jobs:
156156
with:
157157
customParameters: -streamBase64TestDataSet "${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}" -testDataSetIndex ${{ env.SEQUENTIAL_INDEX }}
158158
customImage: ${{ env.DOCKER_TAG }}
159-
timeout-minutes: 20
159+
timeout-minutes: 60
160160
continue-on-error: true
161161

162162
- name: Run Tests (Attempt 4)
@@ -170,7 +170,7 @@ jobs:
170170
with:
171171
customParameters: -streamBase64TestDataSet "${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}" -testDataSetIndex ${{ env.SEQUENTIAL_INDEX }}
172172
customImage: ${{ env.DOCKER_TAG }}
173-
timeout-minutes: 20
173+
timeout-minutes: 60
174174
continue-on-error: true
175175

176176
- name: Run Tests (Attempt 5)
@@ -184,7 +184,7 @@ jobs:
184184
with:
185185
customParameters: -streamBase64TestDataSet "${{ secrets.STREAM_AUTH_TEST_DATA_BASE64 }}" -testDataSetIndex ${{ env.SEQUENTIAL_INDEX }}
186186
customImage: ${{ env.DOCKER_TAG }}
187-
timeout-minutes: 20
187+
timeout-minutes: 60
188188

189189
- name: Upload Test Results as Artifact
190190
uses: actions/upload-artifact@v4
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using StreamChat.Core.LowLevelClient;
3+
4+
namespace StreamChat.Core.Helpers
5+
{
6+
/// <summary>
7+
/// Extensions for <see cref="IEnumeratedStruct{TType}"/>
8+
/// </summary>
9+
internal static class EnumeratedStructExt
10+
{
11+
public static TDomain? TryLoadNullableStructFromDto<TDomain, TDto>(this TDomain? domain, TDto? dto)
12+
where TDomain : struct, IEquatable<TDomain>, ILoadableFrom<TDto, TDomain>
13+
where TDto : struct, IEnumeratedStruct<TDto>
14+
{
15+
if (!dto.HasValue)
16+
{
17+
return null;
18+
}
19+
20+
return domain?.LoadFromDto(dto.Value) ?? default(TDomain).LoadFromDto(dto.Value);
21+
}
22+
23+
public static TDTO? TrySaveNullableStructToDto<TDomain, TDTO>(this TDomain? domain)
24+
where TDomain : struct, IEquatable<TDomain>, ISavableTo<TDTO>
25+
where TDTO : struct, IEnumeratedStruct<TDTO>
26+
{
27+
return domain?.SaveToDto();
28+
}
29+
}
30+
}

Assets/Plugins/StreamChat/Core/Helpers/EnumeratedStructExt.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/StreamChat/Core/Helpers/ILoadableFromExt.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using StreamChat.Core.LowLevelClient;
23

34
namespace StreamChat.Core.Helpers
45
{
@@ -7,24 +8,26 @@ namespace StreamChat.Core.Helpers
78
/// </summary>
89
internal static class ILoadableFromExt
910
{
10-
//StreamTodo: rename to TryCreateFromDto? It's misleading because it creates new instance which you need to replace
11+
/// <summary>
12+
/// Load domain object from the DTO. If the loadable is null, creates a new instance of the domain object.
13+
/// </summary>
1114
public static TDomain TryLoadFromDto<TDto, TDomain>(this ILoadableFrom<TDto, TDomain> loadable, TDto dto)
12-
where TDomain : class, ILoadableFrom<TDto, TDomain>, new()
15+
where TDomain : ILoadableFrom<TDto, TDomain>, new()
1316
{
1417
if (dto == null)
1518
{
16-
return null;
19+
return default;
1720
}
1821

19-
return new TDomain().LoadFromDto(dto);
22+
return loadable != null ? loadable.LoadFromDto(dto) : new TDomain().LoadFromDto(dto);
2023
}
2124

2225
public static TDomain UpdateFromDto<TDto, TDomain>(this ILoadableFrom<TDto, TDomain> loadable, TDto dto)
23-
where TDomain : class, ILoadableFrom<TDto, TDomain>, new()
26+
where TDomain : ILoadableFrom<TDto, TDomain>, new()
2427
{
2528
if (dto == null)
2629
{
27-
return null;
30+
return default;
2831
}
2932

3033
if (loadable == null)

Assets/Plugins/StreamChat/Core/Helpers/ISavableToExt.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace StreamChat.Core.Helpers
88
internal static class ISavableToExt
99
{
1010
public static TDto TrySaveToDto<TDto>(this ISavableTo<TDto> source)
11-
where TDto : class
12-
=> source?.SaveToDto();
11+
=> source != default ? source.SaveToDto() : default;
1312
}
1413
}

Assets/Plugins/StreamChat/Core/ILoadableFrom.cs.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

Assets/Plugins/StreamChat/Core/IStreamChatClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Task<StreamDeleteChannelsResponse> DeleteMultipleChannelsAsync(IEnumerable<IStre
256256
/// <summary>
257257
/// Get current state of unread counts for the user. Unread counts mean how many messages and threads are unread in the channels and threads the user is participating in
258258
/// </summary>
259-
/// <returns><see cref="CurrentUnreadCounts"/></returns>
260-
Task<CurrentUnreadCounts> GetLatestUnreadCountsAsync();
259+
/// <returns><see cref="StreamCurrentUnreadCounts"/></returns>
260+
Task<StreamCurrentUnreadCounts> GetLatestUnreadCountsAsync();
261261
}
262262
}

Assets/Plugins/StreamChat/Core/InternalDTO/Events/NotificationChannelMutesUpdatedEventInternalDTO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal partial class NotificationChannelMutesUpdatedEventInternalDTO
2020
public System.DateTimeOffset CreatedAt { get; set; }
2121

2222
[Newtonsoft.Json.JsonProperty("me", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
23-
public OwnUserInternalDTO Me { get; set; }
23+
public OwnUserInternalDTO Me { get; set; } = new OwnUserInternalDTO();
2424

2525
[Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2626
public string Type { get; set; } = "notification.channel_mutes_updated";

Assets/Plugins/StreamChat/Core/InternalDTO/Events/AnyEventInternalDTO.cs renamed to Assets/Plugins/StreamChat/Core/InternalDTO/Events/WebhookEventInternalDTO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace StreamChat.Core.InternalDTO.Events
1717
/// The discriminator object for all websocket events, it maps events' payload to the final type
1818
/// </summary>
1919
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
20-
internal partial class AnyEventInternalDTO
20+
internal partial class WebhookEventInternalDTO
2121
{
2222

2323
private System.Collections.Generic.Dictionary<string, object> _additionalProperties;

Assets/Plugins/StreamChat/Core/InternalDTO/Models/AutomodBehaviourType.cs.meta renamed to Assets/Plugins/StreamChat/Core/InternalDTO/Events/WebhookEventInternalDTO.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)