Skip to content

Commit

Permalink
Merge branch 'main' into ds/core13.19_sync_errors_changes
Browse files Browse the repository at this point in the history
* main:
  add 'ignore_for_file: type=lint' to *.g.dart files (#1413)
  kn/fix skip then iterate bug (#1410)

# Conflicts:
#	CHANGELOG.md
#	test/asymmetric_test.g.dart
  • Loading branch information
nirinchev committed Oct 30, 2023
2 parents ea21a6a + d5aaf25 commit 266ceb2
Show file tree
Hide file tree
Showing 30 changed files with 113 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## vNext (TBD)

### Enhancements
* Suppressing rules for a *.g.dart files ([#1413](https://github.com/realm/realm-dart/pull/1413))
* Full text search supports searching for prefix only. Eg. "description TEXT 'alex*'" (Core upgrade)
* Unknown protocol errors received from the baas server will no longer cause the application to crash if a valid error action is also received. Unknown error actions will be treated as an ApplicationBug error action and will cause sync to fail with an error via the sync error handler. (Core upgrade)
* Added support for server log messages that are enabled by sync protocol version 10. AppServices request id will be provided in a server log message in a future server release. (Core upgrade)
Expand All @@ -11,6 +12,7 @@
* Throw an exception if `File::unlock` has failed, in order to inform the SDK that we are likely hitting some limitation on the OS filesystem, instead of crashing the application and use the same file locking logic for all the platforms. (Core upgrade)

### Fixed
* Fixed iteration after `skip` bug ([#1409](https://github.com/realm/realm-dart/issues/1409))
* Crash when querying the size of a Object property through a link chain (Core upgrade, since v13.17.2)
* Deprecated `App.localAppName` and `App.localAppVersion`. They were not used by the server and were not needed to set them. ([#1387](https://github.com/realm/realm-dart/pull/1387))
* Fixed crash in slab allocator (Assertion failed: ref + size <= next->first) Many issues like (Core upgrade, since 13.0.0)
Expand Down
2 changes: 2 additions & 0 deletions example/bin/myapp.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flutter/realm_flutter/example/lib/main.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions generator/lib/src/realm_model_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class RealmModelInfo {
const RealmModelInfo(this.name, this.modelName, this.realmName, this.fields, this.baseType);

Iterable<String> toCode() sync* {
yield '// ignore_for_file: type=lint';
yield 'class $name extends $modelName with RealmEntity, RealmObjectBase, ${baseType.className} {';
{
final allSettable = fields.where((f) => !f.type.isRealmCollection && !f.isRealmBacklink).toList();
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class _MappedToo {
// RealmObjectGenerator
// **************************************************************************
// ignore_for_file: type=lint
class MappedToo extends _MappedToo
with RealmEntity, RealmObjectBase, RealmObject {
MappedToo({
Expand Down
3 changes: 3 additions & 0 deletions generator/test/good_test_data/all_types.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down Expand Up @@ -49,6 +50,7 @@ class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class Bar extends _Bar with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down Expand Up @@ -225,6 +227,7 @@ class Bar extends _Bar with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class PrimitiveTypes extends _PrimitiveTypes
with RealmEntity, RealmObjectBase, RealmObject {
PrimitiveTypes(
Expand Down
2 changes: 2 additions & 0 deletions generator/test/good_test_data/asymmetric_object.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Asymmetric extends _Asymmetric
with RealmEntity, RealmObjectBase, RealmObject {
Asymmetric(
Expand Down Expand Up @@ -70,6 +71,7 @@ class Asymmetric extends _Asymmetric
}
}

// ignore_for_file: type=lint
class Embedded extends _Embedded
with RealmEntity, RealmObjectBase, EmbeddedObject {
Embedded(
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/binary_type.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
Foo(
Uint8List requiredBinaryProp, {
Expand Down
2 changes: 2 additions & 0 deletions generator/test/good_test_data/embedded_annotations.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
Parent({
Child1? child,
Expand Down Expand Up @@ -50,6 +51,7 @@ class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class Child1 extends _Child1 with RealmEntity, RealmObjectBase, EmbeddedObject {
Child1(
String value,
Expand Down
3 changes: 3 additions & 0 deletions generator/test/good_test_data/embedded_objects.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
Parent({
Child1? child,
Expand Down Expand Up @@ -47,6 +48,7 @@ class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class Child1 extends _Child1 with RealmEntity, RealmObjectBase, EmbeddedObject {
Child1(
String value, {
Expand Down Expand Up @@ -111,6 +113,7 @@ class Child1 extends _Child1 with RealmEntity, RealmObjectBase, EmbeddedObject {
}
}

// ignore_for_file: type=lint
class Child2 extends _Child2 with RealmEntity, RealmObjectBase, EmbeddedObject {
Child2(
bool boolProp,
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/indexable_types.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Indexable extends _Indexable
with RealmEntity, RealmObjectBase, RealmObject {
Indexable(
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/list_initialization.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person({
Iterable<Person> children = const [],
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/mapto.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Original extends $Original
with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/optional_argument.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person({
Person? spouse,
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/pinhole.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down
8 changes: 8 additions & 0 deletions generator/test/good_test_data/primary_key.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class IntPK extends _IntPK with RealmEntity, RealmObjectBase, RealmObject {
IntPK(
int id,
Expand Down Expand Up @@ -33,6 +34,7 @@ class IntPK extends _IntPK with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class NullableIntPK extends _NullableIntPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableIntPK(
Expand Down Expand Up @@ -67,6 +69,7 @@ class NullableIntPK extends _NullableIntPK
}
}

// ignore_for_file: type=lint
class StringPK extends _StringPK
with RealmEntity, RealmObjectBase, RealmObject {
StringPK(
Expand Down Expand Up @@ -99,6 +102,7 @@ class StringPK extends _StringPK
}
}

// ignore_for_file: type=lint
class NullableStringPK extends _NullableStringPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableStringPK(
Expand Down Expand Up @@ -134,6 +138,7 @@ class NullableStringPK extends _NullableStringPK
}
}

// ignore_for_file: type=lint
class ObjectIdPK extends _ObjectIdPK
with RealmEntity, RealmObjectBase, RealmObject {
ObjectIdPK(
Expand Down Expand Up @@ -166,6 +171,7 @@ class ObjectIdPK extends _ObjectIdPK
}
}

// ignore_for_file: type=lint
class NullableObjectIdPK extends _NullableObjectIdPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableObjectIdPK(
Expand Down Expand Up @@ -201,6 +207,7 @@ class NullableObjectIdPK extends _NullableObjectIdPK
}
}

// ignore_for_file: type=lint
class UuidPK extends _UuidPK with RealmEntity, RealmObjectBase, RealmObject {
UuidPK(
Uuid id,
Expand Down Expand Up @@ -232,6 +239,7 @@ class UuidPK extends _UuidPK with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class NullableUuidPK extends _NullableUuidPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableUuidPK(
Expand Down
2 changes: 2 additions & 0 deletions generator/test/good_test_data/realm_set.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Car extends _Car with RealmEntity, RealmObjectBase, RealmObject {
Car(
String make,
Expand Down Expand Up @@ -33,6 +34,7 @@ class Car extends _Car with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class RealmSets extends _RealmSets
with RealmEntity, RealmObjectBase, RealmObject {
RealmSets(
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/required_argument.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person(
String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/user_defined_getter.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person(
String name,
Expand Down
5 changes: 3 additions & 2 deletions lib/src/results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class RealmResults<T extends Object?> extends Iterable<T> with RealmEntity imple
var results = this;
if (_supportsSnapshot) {
final handle = realmCore.resultsSnapshot(this);
results = RealmResultsInternal.create<T>(handle, realm, _metadata);
results = RealmResultsInternal.create<T>(handle, realm, _metadata, _skipOffset);
}
return _RealmResultsIterator(results);
}
Expand Down Expand Up @@ -184,8 +184,9 @@ extension RealmResultsInternal on RealmResults {
RealmResultsHandle handle,
Realm realm,
RealmObjectMetadata? metadata,
[int skip = 0]
) =>
RealmResults<T>._(handle, realm, metadata);
RealmResults<T>._(handle, realm, metadata, skip);
}

/// Describes the changes in a Realm results collection since the last time the notification callback was invoked.
Expand Down
2 changes: 2 additions & 0 deletions test/backlinks_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/indexed_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions test/migration_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 266ceb2

Please sign in to comment.