Skip to content

Commit

Permalink
V1.5 sync count patch (#620)
Browse files Browse the repository at this point in the history
* updated hardcoded sync count, retry count and error api path

* Published digit_data_model version update
  • Loading branch information
naveenr-egov authored Dec 5, 2024
1 parent 8011a4c commit 5595f37
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
15 changes: 8 additions & 7 deletions apps/health_campaign_field_worker_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: "direct main"
description:
name: attendance_management
sha256: f1b4373e8d0d9f8227ede0d25d4141f0d16d18ac2525c0347b844098cdab080f
sha256: "8a09814ca11cca736d771be70fb6174303ea0cb3525aa72e7239cbc14b915303"
url: "https://pub.dev"
source: hosted
version: "1.0.2+1"
version: "1.0.2+4"
audioplayers:
dependency: "direct main"
description:
Expand Down Expand Up @@ -502,10 +502,10 @@ packages:
dependency: "direct main"
description:
name: digit_data_model
sha256: "0e5a1f8c5f0548e573af9c0279942f2dbc332042865614e0b89fe5952002ef1f"
sha256: "08f5273e691cc16e0f89aefac97887abb63739b7db3a00165c1be269aacedffd"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
version: "1.0.4+1"
digit_dss:
dependency: "direct main"
description:
Expand All @@ -517,9 +517,10 @@ packages:
digit_firebase_services:
dependency: "direct main"
description:
path: "../../packages/digit_firebase_services"
relative: true
source: path
name: digit_firebase_services
sha256: ce76521d797e123b6fc95c9dfad7d4a918a93b97f57aecd0e1d517b46190909d
url: "https://pub.dev"
source: hosted
version: "0.0.1"
digit_location_tracker:
dependency: "direct main"
Expand Down
2 changes: 1 addition & 1 deletion apps/health_campaign_field_worker_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencies:
digit_scanner: ^1.0.3+1
inventory_management: ^1.0.3+4
referral_reconciliation: ^1.0.2+2
digit_data_model: ^1.0.4
digit_data_model: ^1.0.4+1
registration_delivery: ^1.0.3+2
disable_battery_optimization: ^1.1.1
digit_dss: ^1.0.1
Expand Down
4 changes: 2 additions & 2 deletions packages/attendance_management/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ packages:
dependency: "direct main"
description:
name: digit_data_model
sha256: "0b81e96636496b56b4f9c5d918690a17d8985d6b131e0ab54968eb5471ee4f54"
sha256: "0e5a1f8c5f0548e573af9c0279942f2dbc332042865614e0b89fe5952002ef1f"
url: "https://pub.dev"
source: hosted
version: "1.0.3+1"
version: "1.0.4"
dio:
dependency: "direct main"
description:
Expand Down
5 changes: 5 additions & 0 deletions packages/digit_data_model/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.4+1

* Bug Fix:
* Updated syncRetryCount,syncRetryInterval and errorPath to dynamic

## 1.0.4

* Added user_action entity for digit_location_tracker package
Expand Down
2 changes: 1 addition & 1 deletion packages/digit_data_model/lib/data/data_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ abstract class RemoteRepository<D extends EntityModel,
}

return await dio.post(
'error-handler/handle-error', // [TODO: Update this URL]
DigitDataModelSingleton().errorDumpApiPath,
options: Options(headers: {
"content-type": 'application/json',
}),
Expand Down
11 changes: 7 additions & 4 deletions packages/digit_data_model/lib/data/repositories/oplog/oplog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ abstract class OpLogManager<T extends EntityModel> {
.syncedDownEqualTo(false)
.nonRecoverableErrorEqualTo(false)
.syncDownRetryCountGreaterThan(
5 - 1,
DigitDataModelSingleton().syncDownRetryCount - 1,
)
.createdByEqualTo(createdBy)
.findAllSync();
Expand Down Expand Up @@ -112,7 +112,8 @@ abstract class OpLogManager<T extends EntityModel> {
var oplogs = isar.opLogs
.filter()
.syncedUpEqualTo(true)
.syncDownRetryCountLessThan(5)
.syncDownRetryCountLessThan(
DigitDataModelSingleton().syncDownRetryCount)
.syncedDownEqualTo(false)
.entityTypeEqualTo(type)
.findAllSync();
Expand Down Expand Up @@ -299,7 +300,8 @@ abstract class OpLogManager<T extends EntityModel> {
OpLogEntry updatedEntry = entry.copyWith(
syncDownRetryCount: syncDownRetryCount + 1,
);
if (updatedEntry.syncDownRetryCount >= 5) {
if (updatedEntry.syncDownRetryCount >=
DigitDataModelSingleton().syncDownRetryCount) {
markAsNonRecoverable = true;
updatedEntry = updatedEntry.copyWith(nonRecoverableError: true);
}
Expand All @@ -315,7 +317,8 @@ abstract class OpLogManager<T extends EntityModel> {
await Future.delayed(const Duration(seconds: 1));
} else {
await Future.delayed(Duration(
seconds: 5 * oplogs.first.syncDownRetryCount,
seconds: DigitDataModelSingleton().retryTimeInterval *
oplogs.first.syncDownRetryCount,
));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/digit_data_model/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: digit_data_model
description: The digit_data_model package is a data modeling library. It defines various classes, enums, and functions.
version: 1.0.4
version: 1.0.4+1
homepage: https://github.com/egovernments/health-campaign-field-worker-app/tree/master/packages/digit_data_model
repository: https://github.com/egovernments/health-campaign-field-worker-app

Expand Down

0 comments on commit 5595f37

Please sign in to comment.