Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid offset values in the meta file #1036

Closed
brend32 opened this issue Apr 27, 2024 · 2 comments · Fixed by #1044
Closed

Handle invalid offset values in the meta file #1036

brend32 opened this issue Apr 27, 2024 · 2 comments · Fixed by #1044
Assignees
Labels
a-core Relates to the core package b-bug Something isn't working c-accepted The issue is ready to be worked on

Comments

@brend32
Copy link

brend32 commented Apr 27, 2024

Describe the bug
The browser stucks when trying to load events

To Reproduce
Steps to reproduce the behavior
or a code snippet containing the scene that causes the problem:

  1. Set targetTime to null in meta file
  2. Open project
  EditableTimeEvents.ts line 100
      if (changed) {
        event = newEvent;
        this.lookup.set(name, event);
      }
    }

    this.registeredEvents.set(name, event);

   -> return event.offset; // NaN forces infinite loop without possibility to recover

       fix:
       return event.offset ?? 0;
  }

Expected behavior
Fallback to default values

Console errors
Browser not responding

Package versions:
3.15.2

  • core: 3.15.2
@brend32 brend32 added the b-bug Something isn't working label Apr 27, 2024
brend32 added a commit to brend32/motion-canvas that referenced this issue Apr 27, 2024
When events not present in meta file, the event.offset turns into NaN and triggers infinite loop
@aarthificial aarthificial changed the title Browser stuck Handle invalid offset values in the meta file Apr 28, 2024
@aarthificial aarthificial removed their assignment Apr 28, 2024
@aarthificial aarthificial added c-accepted The issue is ready to be worked on a-core Relates to the core package labels Apr 28, 2024
@aarthificial
Copy link
Contributor

aarthificial commented Apr 28, 2024

Did the editor itself generate these null values? Or did you just insert them manually to check what would happen?
If there's some weird behavior causing these nulls to appear in the meta file we should also investigate that.

brend32 added a commit to brend32/motion-canvas that referenced this issue Apr 28, 2024
Previous solution didn't work as expected. Also ?? operator doesn't eliminate NaN values
@brend32
Copy link
Author

brend32 commented Apr 28, 2024

Did the editor itself generate these null values?

I think no. I wanted to fix labels losing timings when using multiple scenes. And I changed signature from targetTime to duration. When updating and moving projects from this version I forgot to delete meta file from second scene that caused infinite loop (two scenes had invalid meta but I deleted meta only for one scene).
Invistigated farther putting null don't break app, invalid number breaks. Also it will stuck for long time if you put large numbers, couse waitFor need yeald all this time to reach scene end. Don't know if there is easy fix, but if it is possible to give browser control back every 10 seconds it would be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-core Relates to the core package b-bug Something isn't working c-accepted The issue is ready to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants