| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Hi @MD-Mushfiqur123! Please fix the following issues with your PR:
Sorry, something went wrong.
There was a problem hiding this comment.
Hi @MD-Mushfiqur123! Please fix the following issues with your PR:
Sorry, something went wrong.
Benchmark report — no significant changeMetrics worse: 0 · better: 0 (threshold: ±3%). benchstat outputgoos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 7763 64-Core Processor
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
ParseSearchQuery_Simple-4 2.695µ ± 32% 2.683µ ± 215% ~ (p=0.818 n=6)
ParseSearchQuery_Complex-4 7.055µ ± 29% 8.034µ ± 34% ~ (p=0.699 n=6)
TokenizeSearchQuery-4 4.139µ ± 22% 5.682µ ± 46% ~ (p=0.132 n=6)
geomean 4.285µ 4.966µ +15.89%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
ParseSearchQuery_Simple-4 26.00 ± 0% 26.00 ± 0% ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4 762.0 ± 0% 762.0 ± 0% ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4 176.0 ± 0% 176.0 ± 3% ~ (p=1.000 n=6)
geomean 151.6 151.6 +0.00%
¹ all samples are equal
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
ParseSearchQuery_Simple-4 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4 23.00 ± 0% 23.00 ± 0% ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4 9.000 ± 0% 9.000 ± 0% ~ (p=1.000 n=6) ¹
geomean 7.453 7.453 +0.00%
¹ all samples are equal
pkg: github.com/floatpane/matcha/tui
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
LogPanelView-4 162.5µ ± 7% 176.0µ ± 13% ~ (p=0.093 n=6)
SearchOverlayView-4 178.3µ ± 23% 180.0µ ± 4% ~ (p=0.937 n=6)
InboxConstruction-4 967.4µ ± 14% 1085.1µ ± 20% ~ (p=0.180 n=6)
geomean 303.7µ 325.1µ +7.05%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
LogPanelView-4 44.67Ki ± 51% 44.67Ki ± 0% ~ (p=1.000 n=6)
SearchOverlayView-4 56.14Ki ± 41% 56.14Ki ± 41% ~ (p=0.530 n=6)
InboxConstruction-4 874.2Ki ± 0% 874.3Ki ± 0% ~ (p=0.485 n=6)
geomean 129.9Ki 129.9Ki +0.00%
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
LogPanelView-4 714.0 ± 0% 714.0 ± 0% ~ (p=1.000 n=6)
SearchOverlayView-4 926.0 ± 0% 926.0 ± 0% ~ (p=1.000 n=6)
InboxConstruction-4 3.478k ± 0% 3.478k ± 0% ~ (p=0.530 n=6)
geomean 1.320k 1.320k +0.00%
auto-generated by benchmarks.yml |
Sorry, something went wrong.
There was a problem hiding this comment.
Hi @MD-Mushfiqur123! Please fix the following issues with your PR:
Sorry, something went wrong.
|
This feature should go to release/v1. Please, move the commit there, AND append other keys. |
Sorry, something went wrong.
There was a problem hiding this comment.
Hi @MD-Mushfiqur123! Please fix the following issues with your PR:
Sorry, something went wrong.
Formatting issues have been resolved. Thank you!
|
All CI checks are passing now. Could this please be reviewed/merged when you get a chance? Thanks! |
Sorry, something went wrong.
|
@MD-Mushfiqur123 please, rebase this PR on release/v1 branch. You can checkout to release/v1, cherry-pick the commit, resolve the conflicts if needed and force push to this branch (please, note, that you need to change target on this PR, you need to edit the title and underneath change master to release/v1) |
Sorry, something went wrong.
|
@andrinoff Done! Rebased on release/v1 and updated the base branch. Thanks for the review! |
Sorry, something went wrong.
There was a problem hiding this comment.
This is a very unreliable implementation, this will add 2 more lists that have to be configured each time, we need a new option. This should replicate the Account and Config structs
Sorry, something went wrong.
| "accounts": true, | ||
| "disable_images": true, | ||
| "hide_tips": true, | ||
| "disable_notifications": true, | ||
| "enable_split_pane": true, | ||
| "enable_threaded": true, | ||
| "enable_detailed_dates": true, | ||
| "theme": true, | ||
| "mailing_lists": true, | ||
| "date_format": true, | ||
| "language": true, | ||
| "body_cache_threshold_mb": true, | ||
| "plugin_settings": true, |
There was a problem hiding this comment.
This is not full
Sorry, something went wrong.
| "id": true, | ||
| "name": true, | ||
| "email": true, | ||
| "password": true, | ||
| "service_provider": true, | ||
| "fetch_email": true, | ||
| "send_as_email": true, | ||
| "imap_server": true, | ||
| "imap_port": true, | ||
| "smtp_server": true, | ||
| "smtp_port": true, | ||
| "insecure": true, | ||
| "smime_cert": true, | ||
| "smime_key": true, | ||
| "smime_sign_by_default": true, | ||
| "pgp_public_key": true, | ||
| "pgp_private_key": true, | ||
| "pgp_key_source": true, | ||
| "pgp_pin": true, | ||
| "pgp_sign_by_default": true, | ||
| "auth_method": true, | ||
| "protocol": true, | ||
| "jmap_endpoint": true, | ||
| "pop3_server": true, | ||
| "pop3_port": true, | ||
| "catch_all": true, | ||
| "pass_cmd": true, |
There was a problem hiding this comment.
this isnt full either
Sorry, something went wrong.
|
@andrinoff Updated! Replaced the hardcoded key maps with reflection-based extraction from Config and Account struct tags. The valid keys are now derived automatically from the struct definitions. |
Sorry, something went wrong.
|
@andrinoff The hardcoded key lists are now replaced with structJSONKeys using reflection on Config and Account struct tags. No more manual lists to maintain. Please re-review when you get a chance! |
Sorry, something went wrong.
|
@andrinoff Rebased on the latest release/v1 and the reflection-based approach is already in place. Could you please re-review when you get a chance? |
Sorry, something went wrong.
There was a problem hiding this comment.
Make assertion tests, these ones test nothing. For the other issue there are several solution, one of them would be to mirror rawAccount struct instead (i am not sure if that is the cleanest solution.
Sorry, something went wrong.
| func TestWarnUnknownConfigKeys(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| json string | ||
| }{ | ||
| {"no unknown keys", `{"accounts": [{"name": "test", "email": "a@b.com", "service_provider": "gmail"}], "theme": "dark"}`}, | ||
| {"empty object", `{}`}, | ||
| {"invalid json", `not json`}, | ||
| {"nested with unknown", `{"unknown_top": true, "accounts": [{"name": "test", "email": "a@b.com", "unknown_field": true}]}`}, | ||
| } | ||
| for _, tc := range tests { | ||
| t.Run(tc.name, func(t *testing.T) { | ||
| warnUnknownConfigKeys([]byte(tc.json)) | ||
| }) | ||
| } | ||
| } |
There was a problem hiding this comment.
1st of all, this test only tests, that the function will not fail, it doesnt test anything, use assertion
Sorry, something went wrong.
|
|
||
| func initKnownKeys() { | ||
| knownConfigKeys = structJSONKeys(Config{}) | ||
| knownAccountKeys = structJSONKeys(Account{}) |
There was a problem hiding this comment.
due to Account struct having Password and PGPPin as json:-, they will most likely not pass the test if config.json has them (user can use it, it will be then migrated to OS-keyrings
Sorry, something went wrong.
|
@andrinoff Updated based on your feedback:
Please re-review when you get a chance! |
Sorry, something went wrong.
Emit a warning via log.Printf listing unrecognized config keys at startup. This helps users catch typos in their config.json. Closes floatpane#1521
Replace hardcoded knownConfigKeys and knownAccountKeys maps with dynamic extraction from Config and Account struct tags via reflection. This eliminates the maintenance burden of keeping the key lists in sync with the struct definitions.
|
Great! The logic now works as expected! Now, there are 2 aspects of this: The current implementation pushes the error to stderr, which will show only after the user quits matcha I'd suggest add an error message via bubble-overlay for the user, as well as adding loglevel verbose print. After that, i think we are good to merge. |
Sorry, something went wrong.
|
This has had no activity for 45 days. It will be closed in 21 days unless updated. Comment or remove the stale label to keep it open. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What?
Emit a warning via log.Printf listing unrecognized config keys at startup, helping users catch typos in their config.json.
Why?
Typos in config keys are silently ignored. This change provides immediate feedback to the user.
How?
Closes #1521