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

Fix incorrect argument when visualizing from tray #780

Merged

Conversation

shashank40
Copy link
Contributor

@shashank40 shashank40 commented Jun 18, 2024

What kind of change does this PR introduce?
Fixing user app replay

Summary
When replaying the video in user app, it always fails with error type int as no value id, reason being that recording_id was passed to recording. Fixed that in this PR

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • New and existing unit tests pass locally with my changes

How can your code be run and tested?

Other information

@shashank40
Copy link
Contributor Author

@abrichr Can you please review this PR?
I have explained the bug above that was causing replay errors in latest build

@abrichr
Copy link
Member

abrichr commented Jun 18, 2024

@shashank40 can you please clarify exactly what error you were experiencing before this change? Console output and screenshots would be very helpful 🙏

@shashank40
Copy link
Contributor Author

@abrichr So basically when we click on replay recordings from the app-tray, our visualize function gets an argument recording_id, but out function definition has recording(of type Recording as the first argument)

Now due to this type mismatch, we tend to fetch id(or any other attribute) from variable of type Recording, but as recording_id(of type int) instead of recording, recording.id failed with an error type int does not have id.

Now after moving recording_id variable up in visualize main function, recording_id will be passed correctly and the app would work correctly.

Screenshot here :
image

@abrichr
Copy link
Member

abrichr commented Jun 19, 2024

Thank you for clarifying @shashank40 !

I believe the fix should be here:

https://github.com/OpenAdaptAI/OpenAdapt/blob/main/openadapt/app/tray.py#L247

If you undo your changes to visualize.py, and modify the above line in tray.py to accept args=(recording) I will be happy to merge this!

@shashank40 shashank40 force-pushed the fix/replay_visualize_fail_for_user_app branch from 45cc5be to 30863c5 Compare June 19, 2024 15:34
@shashank40
Copy link
Contributor Author

Done @abrichr

@shashank40 shashank40 force-pushed the fix/replay_visualize_fail_for_user_app branch from 30863c5 to 2336d13 Compare June 19, 2024 16:21
Copy link
Member

@abrichr abrichr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shashank40
Copy link
Contributor Author

Only you can merge the PR @abrichr 😅

Also if you can take a look at my other 2 PRs. Will merge these 2 functionalities as well

  1. Update: Gitbook user guide. Issue #764 #771
  2. Feat : Add download update feature in user app. Issue #755 #782

@abrichr
Copy link
Member

abrichr commented Jun 20, 2024

@shashank40 was just waiting for tests to run, then got distracted 😅 . Will merge ASAP.

@abrichr abrichr changed the title User app failing in record playing due to incorrect recording argument Fix incorrect argument when visualizing from tray Jun 20, 2024
@abrichr abrichr merged commit 4ff4c73 into OpenAdaptAI:main Jun 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants