[SOLVED] Rule Count Changes/Bugs

I’m submitting a…

  • [x] Regression (a behavior that stopped working in a new release)

Current behavior

When upgrading from v6.7 to v7.7 we notices a few things missing in the rules area UI.

image

  1. The rule count of all rules seem to have been reset.
  2. The rule count updates by 2 every time a rule is run.
  3. The “Last Executed” date is no longer visible.

Expected behavior

image

  1. Rule counters persist across upgrades.
  2. Rule counters update by one each run.
  3. Rules show a “Last Executed” date.

Minimal reproduction of the problem

  • Run 6.7
  • Execute some rules
  • Upgrade to 7.7
  • Rule counts will be wiped, last executed removed
  • Execute some rules
  • Rule count will be double the expected value.

Environment

  • [x] Self hosted with docker

Version: 6.7 & 7.7

Browser:

  • [x] Chrome

Others:

It appears that these are related to some changes being made to the rules system and we want to check which are intentional and if any of them are bugs or unintentional changes?

  1. Could the rule count be migrated from the old storage location to the new storage location via a DB upgrade.
  2. This one seems to be a bug as commenting out one of the two calls to usageTracker.TrackAsync in UsageGate.Rules.cs seems to solve it.
  3. This seems to have been specifically removed. We’d probably look to re-add it in our version as users like it but would be interested if it’s been removed for a reason that we’ve missed.

Many Thanks

Simon

1 Like
  1. Yes, the statistics have been refactored by using an existing collection for all usage data. I can provide a migration for that to copy the old data from the RuleStatistics collection. You could also do it manually. I would have a look to UsagesV2 collection and keys that contains “Rules”. Theoretically we can now provide statistics over time and and for apps and teams.

  2. That’s just a bug and will be fixed next week.

  3. Yes, it was removed as part of the refactoring. We could use the last rule event for that, but we delete old events, which would mean that if LastExecuted is empty it could also be longer than X.

1 Like

This has been fixed and the migration has been added.

Thanks. We’ll do another source pull and let you know how it goes.

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.