Skip to content

Commit 8fb9333

Browse files
authored
Deprecate legacy error codes (#3156)
1 parent a656d96 commit 8fb9333

File tree

6 files changed

+32
-0
lines changed

6 files changed

+32
-0
lines changed

.github/templates/test-ios.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
- #@ template.replace(checkoutCode())
3131
- #@ template.replace(fetchPackageArtifacts())
3232
- #@ setupDotnet()
33+
- name: Set XCode Version
34+
shell: bash
35+
run: |
36+
sudo xcode-select -s "/Applications/Xcode_14.1.app"
37+
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.1.app" >> $GITHUB_ENV
3338
- name: Setup workloads
3439
run: |
3540
dotnet workload install maui

.github/workflows/test-ios.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ jobs:
119119
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
120120
with:
121121
dotnet-version: 6.0.x
122+
- name: Set XCode Version
123+
shell: bash
124+
run: |
125+
sudo xcode-select -s "/Applications/Xcode_14.1.app"
126+
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.1.app" >> $GITHUB_ENV
122127
- name: Setup workloads
123128
run: |
124129
dotnet workload install maui

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* Fixes an issue with where the source generator will not add the namespace for types used in properties' initializers. (Issue [#3135](https://github.com/realm/realm-dotnet/issues/3135))
3737
* Fixed an issue that would prevent Realm from working correctly in Unity applications that have [Domain Reloading](https://docs.unity3d.com/Manual/DomainReloading.html) turned off. (Issue [#2898](https://github.com/realm/realm-dotnet/issues/2898))
3838
* Fixed a bug when using `string.Contains` in .NET 2.1 or later where the search string is not a literal. (Issue [#3134](https://github.com/realm/realm-dotnet/issues/3134))
39+
* Added `[Obsolete]` notice for a few `ErrorCode` enum members that are no longer in use. (Issue [#3155](https://github.com/realm/realm-dotnet/issues/3155)
3940

4041
### Compatibility
4142
* Realm Studio: 12.0.0 or later.

Realm/Realm/DatabaseTypes/RealmDictionary.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace Realms
3333
[Preserve(AllMembers = true)]
3434
[EditorBrowsable(EditorBrowsableState.Never)]
3535
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This should not be directly accessed by users.")]
36+
[SuppressMessage("Design", "CA1010:Generic interface should also be implemented", Justification = "IList conformance is needed for UWP databinding. IList<T> is not necessary.")]
3637
[DebuggerDisplay("Count = {Count}")]
3738
public class RealmDictionary<TValue>
3839
: RealmCollectionBase<KeyValuePair<string, TValue>>,

Realm/Realm/DatabaseTypes/RealmSet.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace Realms
3333
[Preserve(AllMembers = true)]
3434
[EditorBrowsable(EditorBrowsableState.Never)]
3535
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "This should not be directly accessed by users.")]
36+
[SuppressMessage("Design", "CA1010:Generic interface should also be implemented", Justification = "IList conformance is needed for UWP databinding. IList<T> is not necessary.")]
3637
[DebuggerDisplay("Count = {Count}")]
3738
public class RealmSet<T> : RealmCollectionBase<T>, ISet<T>, IDynamicMetaObjectProvider
3839
{

Realm/Realm/Exceptions/Sync/ErrorCode.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
//
1717
////////////////////////////////////////////////////////////////////////////
1818

19+
using System;
20+
1921
namespace Realms.Sync.Exceptions
2022
{
2123
/// <summary>
@@ -97,13 +99,19 @@ public enum ErrorCode
9799
/// <summary>
98100
/// The session has been disabled.
99101
/// </summary>
102+
[Obsolete("This error can no longer happen")]
100103
DisabledSession = 213,
101104

102105
/// <summary>
103106
/// The client file is invalid.
104107
/// </summary>
105108
BadClientFile = 217,
106109

110+
/// <summary>
111+
/// Client file has expired likely due to history compaction on the server.
112+
/// </summary>
113+
ClientFileExpired = 222,
114+
107115
/// <summary>
108116
/// The user for this session doesn't match the user who originally created the file. This can happen
109117
/// if you explicitly specify the Realm file path in the configuration and you open the Realm first with
@@ -159,56 +167,67 @@ public enum ErrorCode
159167
/// <summary>
160168
/// Your request parameters did not validate.
161169
/// </summary>
170+
[Obsolete("This error can no longer happen")]
162171
InvalidParameters = 601,
163172

164173
/// <summary>
165174
/// Your request did not validate because of missing parameters.
166175
/// </summary>
176+
[Obsolete("This error can no longer happen")]
167177
MissingParameters = 602,
168178

169179
/// <summary>
170180
/// The provided credentials are invalid.
171181
/// </summary>
182+
[Obsolete("This error can no longer happen")]
172183
InvalidCredentials = 611,
173184

174185
/// <summary>
175186
/// The account does not exist.
176187
/// </summary>
188+
[Obsolete("This error can no longer happen")]
177189
UnknownAccount = 612,
178190

179191
/// <summary>
180192
/// The account cannot be registered as it exists already.
181193
/// </summary>
194+
[Obsolete("This error can no longer happen")]
182195
ExistingAccount = 613,
183196

184197
/// <summary>
185198
/// The path is invalid or current user has no access.
186199
/// </summary>
200+
[Obsolete("This error can no longer happen")]
187201
AccessDenied = 614,
188202

189203
/// <summary>
190204
/// The refresh token is expired.
191205
/// </summary>
206+
[Obsolete("This error can no longer happen")]
192207
ExpiredRefreshToken = 615,
193208

194209
/// <summary>
195210
/// The server is not authoritative for this URL.
196211
/// </summary>
212+
[Obsolete("This error can no longer happen")]
197213
InvalidHost = 616,
198214

199215
/// <summary>
200216
/// The permission offer is expired.
201217
/// </summary>
218+
[Obsolete("This error can no longer happen")]
202219
ExpiredPermissionOffer = 701,
203220

204221
/// <summary>
205222
/// The token used on the permission request does match more than a single permission offer.
206223
/// </summary>
224+
[Obsolete("This error can no longer happen")]
207225
AmbiguousPermissionOfferToken = 702,
208226

209227
/// <summary>
210228
/// The Realm file at the specified path is not available for shared access.
211229
/// </summary>
230+
[Obsolete("This error can no longer happen")]
212231
FileMayNotBeShared = 703,
213232
}
214233
}

0 commit comments

Comments
 (0)