Skip to content

Commit 4a8888a

Browse files
authored
Update to latest Core (#3016)
1 parent 2c9222a commit 4a8888a

27 files changed

+437
-504
lines changed

.github/templates/common.lib.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,16 @@ with:
104104
shell: bash
105105
run: echo "::set-output name=commit::$(git rev-parse HEAD)"
106106
- name: Setup Vcpkg
107+
id: setup-vcpkg
107108
uses: friendlyanon/setup-vcpkg@v1
108109
#@yaml/text-templated-strings
109110
with:
110111
path: wrappers/realm-core/tools/vcpkg/ports
111-
cache-key: vcpkg-(@= preset @)-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}-${{ steps.vcpkg_cache_key.outputs.commit }}
112-
cache-restore-keys: vcpkg-(@= preset @)-
112+
cache-key: vcpkg3-(@= preset @)-${{ steps.vcpkg_cache_key.outputs.commit }}-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}
113+
cache-restore-keys: vcpkg3-(@= preset @)-${{ steps.vcpkg_cache_key.outputs.commit }}
114+
- name: Refetch vcpkg
115+
run: git fetch --unshallow
116+
working-directory: wrappers/realm-core/tools/vcpkg/ports
113117
#@ end
114118

115119
#@ def downloadAllArtifacts(conclusion = "completed"):
@@ -194,6 +198,7 @@ with:
194198
name: #@ artifactName
195199
path: #@ "${{ github.workspace }}/" + relPath
196200
retention-days: #@ retentionDays
201+
if-no-files-found: error
197202
#@ end
198203
---
199204
#@ def setupDotnet(version = "6.0.x", ifCondition = ""):

.github/workflows/build-packages.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,30 +149,35 @@ jobs:
149149
name: Realm.Fody.${{ steps.get-version.outputs.version }}
150150
path: ${{ github.workspace }}/Realm/packages/Realm.Fody.${{ steps.get-version.outputs.version }}.*nupkg
151151
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
152+
if-no-files-found: error
152153
- name: Store artifacts for Realm.${{ steps.get-version.outputs.version }}
153154
uses: actions/upload-artifact@v2
154155
with:
155156
name: Realm.${{ steps.get-version.outputs.version }}
156157
path: ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}.*nupkg
157158
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
159+
if-no-files-found: error
158160
- name: Store artifacts for Realm.UnityUtils.${{ steps.get-version.outputs.version }}
159161
uses: actions/upload-artifact@v2
160162
with:
161163
name: Realm.UnityUtils.${{ steps.get-version.outputs.version }}
162164
path: ${{ github.workspace }}/Realm/packages/Realm.UnityUtils.${{ steps.get-version.outputs.version }}.*nupkg
163165
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
166+
if-no-files-found: error
164167
- name: Store artifacts for Realm.UnityWeaver.${{ steps.get-version.outputs.version }}
165168
uses: actions/upload-artifact@v2
166169
with:
167170
name: Realm.UnityWeaver.${{ steps.get-version.outputs.version }}
168171
path: ${{ github.workspace }}/Realm/packages/Realm.UnityWeaver.${{ steps.get-version.outputs.version }}.*nupkg
169172
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
173+
if-no-files-found: error
170174
- name: Store artifacts for ExtractedChangelog
171175
uses: actions/upload-artifact@v2
172176
with:
173177
name: ExtractedChangelog
174178
path: ${{ github.workspace }}/Realm/Realm/ExtractedChangelog.md
175179
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
180+
if-no-files-found: error
176181
- name: Check Docfx cache
177182
id: check-docfx-cache
178183
if: inputs.build-docs
@@ -197,4 +202,5 @@ jobs:
197202
name: Docs.zip
198203
path: ${{ github.workspace }}/Realm/packages/Docs.zip
199204
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
205+
if-no-files-found: error
200206
if: inputs.build-docs

.github/workflows/build-unity.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ jobs:
5151
name: io.realm.unity-${{ inputs.version }}.tgz
5252
path: ${{ github.workspace }}/Realm/Realm.Unity/io.realm.unity-${{ inputs.version }}.tgz
5353
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
54+
if-no-files-found: error
5455
- name: Store artifacts for AssetStorePublisher-${{ inputs.version }}
5556
uses: actions/upload-artifact@v2
5657
with:
5758
name: AssetStorePublisher-${{ inputs.version }}
5859
path: ${{ github.workspace }}/Tools/AssetStorePublisher
5960
retention-days: ${{ (github.event_name != 'pull_request' || contains(github.head_ref, 'release')) && 30 || 1 }}
61+
if-no-files-found: error
6062
- name: Build Tests
6163
run: dotnet run --project Tools/SetupUnityPackage/ -- tests --realm-package Realm/Realm.Unity/io.realm.unity-${{ inputs.version }}.tgz
6264
- name: Store artifacts for UnityTests
@@ -65,3 +67,4 @@ jobs:
6567
name: UnityTests
6668
path: ${{ github.workspace }}/Tests/Tests.Unity
6769
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
70+
if-no-files-found: error

.github/workflows/codeql.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ jobs:
3838
shell: bash
3939
run: echo "::set-output name=commit::$(git rev-parse HEAD)"
4040
- name: Setup Vcpkg
41+
id: setup-vcpkg
4142
uses: friendlyanon/setup-vcpkg@v1
4243
with:
4344
path: wrappers/realm-core/tools/vcpkg/ports
44-
cache-key: vcpkg-windows-x64-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}-${{ steps.vcpkg_cache_key.outputs.commit }}
45-
cache-restore-keys: vcpkg-windows-x64-
45+
cache-key: vcpkg3-windows-x64-${{ steps.vcpkg_cache_key.outputs.commit }}-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}
46+
cache-restore-keys: vcpkg3-windows-x64-${{ steps.vcpkg_cache_key.outputs.commit }}
47+
- name: Refetch vcpkg
48+
run: git fetch --unshallow
49+
working-directory: wrappers/realm-core/tools/vcpkg/ports
4650
- name: Build wrappers
4751
run: powershell ./wrappers/build.ps1 Windows -Platforms x64 -Configuration Release
4852
- name: Perform CodeQL Analysis

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ jobs:
285285
name: dashboard.charts
286286
path: ${{ github.workspace }}/dashboard.charts
287287
retention-days: 30
288+
if-no-files-found: error
288289
cleanup-cluster:
289290
uses: ./.github/workflows/cleanup-baas.yml
290291
if: always()

.github/workflows/wrappers.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
name: wrappers-macos
5252
path: ${{ github.workspace }}/wrappers/build/**
5353
retention-days: 1
54+
if-no-files-found: error
5455
if: matrix.os == 'ubuntu' && steps.check-cache-macos.outputs.cache-hit == 'true'
5556
- run: git clean -fdx
5657
if: matrix.os == 'ubuntu'
@@ -67,6 +68,7 @@ jobs:
6768
name: wrappers-linux
6869
path: ${{ github.workspace }}/wrappers/build/**
6970
retention-days: 1
71+
if-no-files-found: error
7072
if: matrix.os == 'ubuntu' && steps.check-cache-linux.outputs.cache-hit == 'true'
7173
- run: git clean -fdx
7274
if: matrix.os == 'ubuntu'
@@ -83,6 +85,7 @@ jobs:
8385
name: wrappers-ios-Simulator
8486
path: ${{ github.workspace }}/wrappers/build/**
8587
retention-days: 1
88+
if-no-files-found: error
8689
if: matrix.os == 'ubuntu' && steps.check-cache-ios-Simulator.outputs.cache-hit == 'true'
8790
- run: git clean -fdx
8891
if: matrix.os == 'ubuntu'
@@ -99,6 +102,7 @@ jobs:
99102
name: wrappers-ios-Device
100103
path: ${{ github.workspace }}/wrappers/build/**
101104
retention-days: 1
105+
if-no-files-found: error
102106
if: matrix.os == 'ubuntu' && steps.check-cache-ios-Device.outputs.cache-hit == 'true'
103107
- run: git clean -fdx
104108
if: matrix.os == 'ubuntu'
@@ -115,6 +119,7 @@ jobs:
115119
name: wrappers-ios-Catalyst
116120
path: ${{ github.workspace }}/wrappers/build/**
117121
retention-days: 1
122+
if-no-files-found: error
118123
if: matrix.os == 'ubuntu' && steps.check-cache-ios-Catalyst.outputs.cache-hit == 'true'
119124
- run: git clean -fdx
120125
if: matrix.os == 'ubuntu'
@@ -131,6 +136,7 @@ jobs:
131136
name: wrappers-android-armeabi-v7a
132137
path: ${{ github.workspace }}/wrappers/build/**
133138
retention-days: 1
139+
if-no-files-found: error
134140
if: matrix.os == 'ubuntu' && steps.check-cache-android-armeabi-v7a.outputs.cache-hit == 'true'
135141
- run: git clean -fdx
136142
if: matrix.os == 'ubuntu'
@@ -147,6 +153,7 @@ jobs:
147153
name: wrappers-android-arm64-v8a
148154
path: ${{ github.workspace }}/wrappers/build/**
149155
retention-days: 1
156+
if-no-files-found: error
150157
if: matrix.os == 'ubuntu' && steps.check-cache-android-arm64-v8a.outputs.cache-hit == 'true'
151158
- run: git clean -fdx
152159
if: matrix.os == 'ubuntu'
@@ -163,6 +170,7 @@ jobs:
163170
name: wrappers-android-x86
164171
path: ${{ github.workspace }}/wrappers/build/**
165172
retention-days: 1
173+
if-no-files-found: error
166174
if: matrix.os == 'ubuntu' && steps.check-cache-android-x86.outputs.cache-hit == 'true'
167175
- run: git clean -fdx
168176
if: matrix.os == 'ubuntu'
@@ -179,6 +187,7 @@ jobs:
179187
name: wrappers-android-x86_64
180188
path: ${{ github.workspace }}/wrappers/build/**
181189
retention-days: 1
190+
if-no-files-found: error
182191
if: matrix.os == 'ubuntu' && steps.check-cache-android-x86_64.outputs.cache-hit == 'true'
183192
- run: git clean -fdx
184193
if: matrix.os == 'ubuntu'
@@ -195,6 +204,7 @@ jobs:
195204
name: wrappers-windows-Win32
196205
path: ${{ github.workspace }}/wrappers/build/**
197206
retention-days: 1
207+
if-no-files-found: error
198208
if: matrix.os == 'windows' && steps.check-cache-windows-Win32.outputs.cache-hit == 'true'
199209
- run: git clean -fdx
200210
if: matrix.os == 'windows'
@@ -211,6 +221,7 @@ jobs:
211221
name: wrappers-windows-x64
212222
path: ${{ github.workspace }}/wrappers/build/**
213223
retention-days: 1
224+
if-no-files-found: error
214225
if: matrix.os == 'windows' && steps.check-cache-windows-x64.outputs.cache-hit == 'true'
215226
- run: git clean -fdx
216227
if: matrix.os == 'windows'
@@ -227,6 +238,7 @@ jobs:
227238
name: wrappers-windows-ARM64
228239
path: ${{ github.workspace }}/wrappers/build/**
229240
retention-days: 1
241+
if-no-files-found: error
230242
if: matrix.os == 'windows' && steps.check-cache-windows-ARM64.outputs.cache-hit == 'true'
231243
- run: git clean -fdx
232244
if: matrix.os == 'windows'
@@ -243,6 +255,7 @@ jobs:
243255
name: wrappers-windows-uwp-Win32
244256
path: ${{ github.workspace }}/wrappers/build/**
245257
retention-days: 1
258+
if-no-files-found: error
246259
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-Win32.outputs.cache-hit == 'true'
247260
- run: git clean -fdx
248261
if: matrix.os == 'windows'
@@ -259,6 +272,7 @@ jobs:
259272
name: wrappers-windows-uwp-x64
260273
path: ${{ github.workspace }}/wrappers/build/**
261274
retention-days: 1
275+
if-no-files-found: error
262276
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-x64.outputs.cache-hit == 'true'
263277
- run: git clean -fdx
264278
if: matrix.os == 'windows'
@@ -275,6 +289,7 @@ jobs:
275289
name: wrappers-windows-uwp-ARM
276290
path: ${{ github.workspace }}/wrappers/build/**
277291
retention-days: 1
292+
if-no-files-found: error
278293
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-ARM.outputs.cache-hit == 'true'
279294
- run: git clean -fdx
280295
if: matrix.os == 'windows'
@@ -291,6 +306,7 @@ jobs:
291306
name: wrappers-windows-uwp-ARM64
292307
path: ${{ github.workspace }}/wrappers/build/**
293308
retention-days: 1
309+
if-no-files-found: error
294310
if: matrix.os == 'windows' && steps.check-cache-windows-uwp-ARM64.outputs.cache-hit == 'true'
295311
- run: git clean -fdx
296312
if: matrix.os == 'windows'
@@ -322,6 +338,7 @@ jobs:
322338
name: wrappers-macos
323339
path: ${{ github.workspace }}/wrappers/build/**
324340
retention-days: 1
341+
if-no-files-found: error
325342
ios:
326343
runs-on: macos-latest
327344
name: iOS
@@ -355,6 +372,7 @@ jobs:
355372
name: wrappers-ios-${{ matrix.arch }}
356373
path: ${{ github.workspace }}/wrappers/build/**
357374
retention-days: 1
375+
if-no-files-found: error
358376
if: needs.check-cache.outputs.wrappers-ios-Simulator != 'true' || needs.check-cache.outputs.wrappers-ios-Device != 'true' || needs.check-cache.outputs.wrappers-ios-Catalyst != 'true'
359377
linux:
360378
runs-on: ubuntu-latest
@@ -403,6 +421,7 @@ jobs:
403421
name: wrappers-linux
404422
path: ${{ github.workspace }}/wrappers/build/**
405423
retention-days: 1
424+
if-no-files-found: error
406425
android:
407426
runs-on: ubuntu-20.04
408427
name: Android
@@ -437,6 +456,7 @@ jobs:
437456
name: wrappers-android-${{ matrix.arch }}
438457
path: ${{ github.workspace }}/wrappers/build/**
439458
retention-days: 1
459+
if-no-files-found: error
440460
if: needs.check-cache.outputs.wrappers-android-armeabi-v7a != 'true' || needs.check-cache.outputs.wrappers-android-arm64-v8a != 'true' || needs.check-cache.outputs.wrappers-android-x86 != 'true' || needs.check-cache.outputs.wrappers-android-x86_64 != 'true'
441461
windows:
442462
runs-on: windows-latest
@@ -468,11 +488,15 @@ jobs:
468488
shell: bash
469489
run: echo "::set-output name=commit::$(git rev-parse HEAD)"
470490
- name: Setup Vcpkg
491+
id: setup-vcpkg
471492
uses: friendlyanon/setup-vcpkg@v1
472493
with:
473494
path: wrappers/realm-core/tools/vcpkg/ports
474-
cache-key: vcpkg-windows-${{ matrix.arch }}-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}-${{ steps.vcpkg_cache_key.outputs.commit }}
475-
cache-restore-keys: vcpkg-windows-${{ matrix.arch }}-
495+
cache-key: vcpkg3-windows-${{ matrix.arch }}-${{ steps.vcpkg_cache_key.outputs.commit }}-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}
496+
cache-restore-keys: vcpkg3-windows-${{ matrix.arch }}-${{ steps.vcpkg_cache_key.outputs.commit }}
497+
- name: Refetch vcpkg
498+
run: git fetch --unshallow
499+
working-directory: wrappers/realm-core/tools/vcpkg/ports
476500
- name: Build wrappers
477501
run: pwsh ./wrappers/build.ps1 Windows -Platforms ${{ matrix.arch }} -Configuration Release -EnableLTO
478502
if: steps.check-cache.outputs.cache-hit != 'true'
@@ -482,6 +506,7 @@ jobs:
482506
name: wrappers-windows-${{ matrix.arch }}
483507
path: ${{ github.workspace }}/wrappers/build/**
484508
retention-days: 1
509+
if-no-files-found: error
485510
if: needs.check-cache.outputs.wrappers-windows-Win32 != 'true' || needs.check-cache.outputs.wrappers-windows-x64 != 'true' || needs.check-cache.outputs.wrappers-windows-ARM64 != 'true'
486511
uwp:
487512
runs-on: windows-latest
@@ -514,11 +539,15 @@ jobs:
514539
shell: bash
515540
run: echo "::set-output name=commit::$(git rev-parse HEAD)"
516541
- name: Setup Vcpkg
542+
id: setup-vcpkg
517543
uses: friendlyanon/setup-vcpkg@v1
518544
with:
519545
path: wrappers/realm-core/tools/vcpkg/ports
520-
cache-key: vcpkg-uwp-${{ matrix.arch }}-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}-${{ steps.vcpkg_cache_key.outputs.commit }}
521-
cache-restore-keys: vcpkg-uwp-${{ matrix.arch }}-
546+
cache-key: vcpkg3-uwp-${{ matrix.arch }}-${{ steps.vcpkg_cache_key.outputs.commit }}-${{ hashFiles('./wrappers/realm-core/tools/vcpkg/vcpkg.json') }}
547+
cache-restore-keys: vcpkg3-uwp-${{ matrix.arch }}-${{ steps.vcpkg_cache_key.outputs.commit }}
548+
- name: Refetch vcpkg
549+
run: git fetch --unshallow
550+
working-directory: wrappers/realm-core/tools/vcpkg/ports
522551
- name: Build wrappers
523552
run: pwsh ./wrappers/build.ps1 WindowsStore -Platforms ${{ matrix.arch }} -Configuration Release -EnableLTO
524553
if: steps.check-cache.outputs.cache-hit != 'true'
@@ -528,4 +557,5 @@ jobs:
528557
name: wrappers-windows-uwp-${{ matrix.arch }}
529558
path: ${{ github.workspace }}/wrappers/build/**
530559
retention-days: 1
560+
if-no-files-found: error
531561
if: needs.check-cache.outputs.wrappers-windows-uwp-Win32 != 'true' || needs.check-cache.outputs.wrappers-windows-uwp-x64 != 'true' || needs.check-cache.outputs.wrappers-windows-uwp-ARM != 'true' || needs.check-cache.outputs.wrappers-windows-uwp-ARM64 != 'true'

Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,9 @@ public void UnsubscribeFromNotifications()
155155
}
156156

157157
/// <inheritdoc/>
158-
void INotifiable<NotifiableObjectHandleBase.CollectionChangeSet>.NotifyCallbacks(NotifiableObjectHandleBase.CollectionChangeSet? changes, NativeException? exception)
158+
void INotifiable<NotifiableObjectHandleBase.CollectionChangeSet>.NotifyCallbacks(NotifiableObjectHandleBase.CollectionChangeSet? changes)
159159
{
160-
var managedException = exception?.Convert();
161-
162-
if (managedException != null)
163-
{
164-
Realm.NotifyError(managedException);
165-
}
166-
else if (changes.HasValue)
160+
if (changes.HasValue)
167161
{
168162
foreach (int propertyIndex in changes.Value.Properties.AsEnumerable())
169163
{

Realm/Realm/DatabaseTypes/INotifiable.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ internal interface INotifiable<TChangeset>
3333
/// Method called when there are changes to report for that object.
3434
/// </summary>
3535
/// <param name="changes">The changes that occurred.</param>
36-
/// <param name="exception">An exception if one occurred.</param>
37-
void NotifyCallbacks(TChangeset? changes, NativeException? exception);
36+
void NotifyCallbacks(TChangeset? changes);
3837
}
3938

4039
internal class NotificationToken<TCallback> : IDisposable

Realm/Realm/DatabaseTypes/RealmCollectionBase.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public abstract class RealmCollectionBase<T>
4141
IThreadConfined,
4242
IMetadataObject
4343
{
44-
private readonly List<NotificationCallbackDelegate<T>> _callbacks = new List<NotificationCallbackDelegate<T>>();
44+
private readonly List<NotificationCallbackDelegate<T>> _callbacks = new();
4545

4646
private NotificationTokenHandle _notificationToken;
4747

@@ -395,9 +395,8 @@ private void UpdateCollectionChangedSubscriptionIfNecessary(bool isSubscribed)
395395

396396
#endregion INotifyCollectionChanged
397397

398-
void INotifiable<NotifiableObjectHandleBase.CollectionChangeSet>.NotifyCallbacks(NotifiableObjectHandleBase.CollectionChangeSet? changes, NativeException? exception)
398+
void INotifiable<NotifiableObjectHandleBase.CollectionChangeSet>.NotifyCallbacks(NotifiableObjectHandleBase.CollectionChangeSet? changes)
399399
{
400-
var managedException = exception?.Convert();
401400
ChangeSet changeset = null;
402401
if (changes != null)
403402
{
@@ -417,7 +416,7 @@ private void UpdateCollectionChangedSubscriptionIfNecessary(bool isSubscribed)
417416

418417
foreach (var callback in _callbacks.ToArray())
419418
{
420-
callback(this, changeset, managedException);
419+
callback(this, changeset, null);
421420
}
422421
}
423422

0 commit comments

Comments
 (0)