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

Issue with retrieving unitType enums from a list #32

Closed
mikeogezi opened this issue Dec 2, 2023 · 1 comment
Closed

Issue with retrieving unitType enums from a list #32

mikeogezi opened this issue Dec 2, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mikeogezi
Copy link
Contributor

Describe the bug
I run into a panic when I try to use a unitType enum that I retrieved from a list as an argument. This is similar to Issue #31

To Reproduce

@utlist = list("Length", "Angle")
@l = getListItem(utlist, 0)
@a = getListItem(utlist, 1)
@meas = measurement("2000", l, "meter")
@val = convertMeasurement(meas, l, "ft")

Debug output
Parsing custom actions... ### CUSTOM ACTIONS ###

done!
Parsing test.cherri...
panic: interface conversion: interface {} is main.action, not string

goroutine 1 [running]:
main.webActions.func11({0x14000104300, 0x3, 0x140000ae910?})
/Users/michaelogezi/Documents/projects/-cherri/cherri/actions_std.go:4926 +0x158
main.checkAction()
/Users/michaelogezi/Documents/projects/-cherri/cherri/action.go:204 +0x7c
main.collectAction()
/Users/michaelogezi/Documents/projects/-cherri/cherri/parser.go:1195 +0x270
main.collectValue(0x14000111790, 0x140001117a0, 0xa)
/Users/michaelogezi/Documents/projects/-cherri/cherri/parser.go:308 +0x4e4
main.collectVariableValue(0x0, 0x14000111790, 0x140001117a0, 0x140001117d0, 0x140001117c0)
/Users/michaelogezi/Documents/projects/-cherri/cherri/parser.go:241 +0x3c
main.collectVariable(0x0)
/Users/michaelogezi/Documents/projects/-cherri/cherri/parser.go:486 +0x6e8
main.parse()
/Users/michaelogezi/Documents/projects/-cherri/cherri/parser.go:148 +0x480
main.initParse()
/Users/michaelogezi/Documents/projects/-cherri/cherri/parser.go:50 +0x2f4
main.main()
/Users/michaelogezi/Documents/projects/-cherri/cherri/main.go:75 +0x35c
exit status 2

Expected behavior
I expect the retrieved enum to work as an argument.

Screenshots
N/A

Version Information (please complete the following information):

  • macOS version (run uname -a): Darwin Michaels-MacBook-Air.local 23.2.0 Darwin Kernel Version 23.2.0: Fri Oct 13 09:28:08 PDT 2023; root:xnu-10002.60.54~14/RELEASE_ARM64_T8112 arm64
  • Golang version (run go version): go version go1.21.4 darwin/arm64

Additional context
N/A

@mikeogezi mikeogezi added the bug Something isn't working label Dec 2, 2023
@electrikmilk electrikmilk self-assigned this Dec 3, 2023
@electrikmilk
Copy link
Owner

electrikmilk commented Dec 3, 2023

Thanks for finding this! We have more a complex value structure for measurements that required manual enum checking, that's why this got missed by the last fix.

Part of this is not possible to fix, as the measurement action does not accept variables in the Shortcuts app itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants