mathgladiator / adama-lang

A headless spreadsheet document container service.
https://www.adama-platform.com/
GNU Affero General Public License v3.0
107 stars 15 forks source link

Time.today() is not reactive #140

Closed mathgladiator closed 1 year ago

mathgladiator commented 1 year ago

A user that transitions from 11:59PM to 12:00AM will not trigger an update. Similar to Time.datetime() and Time.now();

At core, I need a new subscription base for Time.$X() calls in bubbles/formulas where a meaningful invalidation happens on a schedule.

mathgladiator commented 1 year ago

This can be fixed because we can detect when Time is used.

mathgladiator commented 1 year ago

if (resolved instanceof TyNativeGlobalObject) { if( ((TyNativeGlobalObject) resolved).globalName.equals("Time")) { depends.add("__time"); } return; };

this can help fix the issue, but it also introduces noise for pure methods.

mathgladiator commented 1 year ago
      if (resolved instanceof TyNativeGlobalObject) {
        if( ((TyNativeGlobalObject) resolved).globalName.equals("Time")) {
          depends.add("__time");
        }
        return;
      };
mathgladiator commented 1 year ago

Also, this makes me think we need to sort out how fields within a record/message/global contribute to the dependencies of a function. We should test methods on records don't break reactivity in bubbles.