atsign-foundation / at_client_sdk

The Dart implementation of atSDK used for implementing Atsign's technology into other software
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
1.47k stars 32 forks source link

delete expired keys cron job is not triggered #1350

Closed srieteja closed 1 month ago

srieteja commented 1 month ago

Describe the bug

The client-side job to delete expired keys is not being triggered. Although, this is not an issue as the server still sends the commit entries for expired keys that need to be removed. The issue being: logic to parse Duration() type input in AtClientPreferences into a Schedule() type object is faulty.

Steps to reproduce

  1. Create a new instance of AtClient
  2. Observe that the deleteExpiredKeys job does not run at 10min intervals, which it is scheduled to do.

Expected behavior

The cron job to remove expired keys should run at scheduled intervals and remove all expired keys.

Additional context

The logic introduced in '' relies on the constructor in Schedule(); which does not allow the cron job to run at scheduled intervals instead only at one specific time of day. e.g. Schedule(minutes: 10, seconds: 30) would mean it would run at 00:10:30s everyday instead of running every 10min30s.