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

Broken Errors Posting on Wrong Threads #136

Closed
0x4007 opened this issue Feb 5, 2025 · 16 comments · Fixed by #137
Closed

Broken Errors Posting on Wrong Threads #136

0x4007 opened this issue Feb 5, 2025 · 16 comments · Fixed by #137

Comments

@0x4007
Copy link
Member

0x4007 commented Feb 5, 2025

I also don’t understand why the function name is parsed as “async” that’s not actually possible in JavaScript I would imagine.

  • Fix the function name to be correct (requires changes in SDK)
  • make stack trace with source map
  • fix aggregate error message to show something
  • make sure it posts where it's supposed to (not on a wrong thread)
  • remove "no labels are set" error below. Or more specifically only throw that (as a warning, not a caution - I.e. a "4xx class, user/client error") when the slash command is used. Assignments from the GitHub ui should serve as an override and not throw any errors.

[!CAUTION]

<!-- UbiquityOS - async - 2074e5f5-cd87-4325-a261-b26f990910d3 - @Developer-Harshit - https://dash.cloudflare.com/17b9dfa79e16b79dffcb11a66768539c/workers/services/view/ubiquity-os-command-start-stop-development/production/observability/logs?granularity=0&time=%7B%22type%22%3A%22absolute%22%2C%22to%22%3A1738774664711%2C%22from%22%3A1738774544711%7D
{
  "message": "",
  "name": "AggregateError",
  "stack": "AggregateError\n    at start (index.js:58261:11)\n    at async userStartStop (index.js:58484:12)\n    at async startStopTask (index.js:58643:14)\n    at async Array.&lt;anonymous&gt; (index.js:48626:22)"
}
-->

Originally posted by @ubiquity-os-beta in ubiquity-os-marketplace/daemon-disqualifier#51 (comment)

Copy link

ubiquity-os-beta bot commented Feb 5, 2025

Note

The following contributors may be suitable for this task:

gentlementlegen

83% Match ubiquity-os-marketplace/command-start-stop#60
78% Match ubiquity-os-marketplace/daemon-disqualifier#41

Copy link

ubiquity-os-beta bot commented Feb 5, 2025

Caution

No labels are set.

@0x4007
Copy link
Member Author

0x4007 commented Feb 5, 2025

@whilefoo please set a time label.

@0x4007
Copy link
Member Author

0x4007 commented Feb 5, 2025

Also this error shouldn't occur on UI assignment. Only with /start command.

[!CAUTION]
No labels are set.

<!-- UbiquityOS - userSelfAssign - 2074e5f5-cd87-4325-a261-b26f990910d3 - @0x4007 - https://dash.cloudflare.com/17b9dfa79e16b79dffcb11a66768539c/workers/services/view/ubiquity-os-command-start-stop-development/production/observability/logs?granularity=0&time=%7B%22type%22%3A%22absolute%22%2C%22to%22%3A1738784784170%2C%22from%22%3A1738784664170%7D
{
  "message": "No labels are set.",
  "name": "Error",
  "stack": "Error: No labels are set.\n    at getDeadline (index.js:57917:11)\n    at userSelfAssign (index.js:58492:20)\n    at startStopTask (index.js:58645:20)\n    at async Array.&lt;anonymous&gt; (index.js:48626:22)"
}
-->

@0x4007 0x4007 marked this as a duplicate of #135 Feb 5, 2025
@whilefoo
Copy link
Member

whilefoo commented Feb 5, 2025

  • make sure it posts where it's supposed to (not on a wrong thread)

At first it seemed like that the plugin responded to the comment twice, once in the same issue and once in another issue, because both responses are the same, and the second response from /stop comment is also posted in the other issue.

I found out that the comments were 3 minutes apart, also logs are logged twice confirming that this were two separate runs. @0x4007 checked the audit and confirmed my suspicion that the user deleted their comments, so that's why it looked like a bug.

  • remove "no labels are set" error below. Or more specifically only throw that (as a warning, not a caution - I.e. a "4xx class, user/client error") when the slash command is used. Assignments from the GitHub ui should serve as an override and not throw any errors.

Normally on slash command, a caution with message No price label is set to calculate the duration is posted. The handler for self assign is only fetching the deadline and doing nothing with it, but it fails with No labels are set.. Maybe @gentlementlegen can tell what was the purpose of that

@gentlementlegen
Copy link
Member

The user deleted their comments, you can see from the metadata the instigator. You can also check the linked logs which show where the user commented, and what happened during the run.

About the no price label, I believe this was not intended.

@0x4007
Copy link
Member Author

0x4007 commented Feb 6, 2025

/ask how many hours of active effort would you predict this task to take for somebody familiar with the codebase?

Copy link

ubiquity-os-beta bot commented Feb 6, 2025

Based on the chat history and the complexity of the issue, I would estimate this task would take approximately 4-6 hours of active effort for someone familiar with the codebase. Here's my breakdown:

  1. Core Development (2-3 hours):
  • Implementing the fix for the function name parsing issue
  • Adding source map support for stack traces
  • Fixing the aggregate error message display
  • Adjusting the label error handling logic
  1. Testing & Validation (1-2 hours):
  • Testing different scenarios for label handling
  • Verifying error message displays
  • Testing source map functionality
  • Ensuring proper thread posting
  1. Documentation & Cleanup (1 hour):
  • Updating any relevant documentation
  • Code cleanup and formatting
  • Writing test cases

This estimate assumes:

  • Familiarity with the TypeScript/JavaScript codebase
  • Understanding of the Ubiquity OS plugin SDK
  • Experience with error handling and source maps
  • Knowledge of GitHub's API and label system

The task appears to be primarily focused on error handling improvements and message display fixes, which are relatively contained changes but require careful testing to ensure proper functionality.

@0x4007
Copy link
Member Author

0x4007 commented Feb 6, 2025

Not a bad estimate I would have put <4 hours. Maybe we can start experimenting with an LLM to set time labels for estimates.

@shiv810 check it out

@gentlementlegen
Copy link
Member

Part of this issue was actually contained within another issue: #138

I guess if everything is done here I'll close the other one.

@gentlementlegen gentlementlegen marked this as a duplicate of #138 Feb 6, 2025
@whilefoo
Copy link
Member

whilefoo commented Feb 6, 2025

  • make stack trace with source map

It turns out this is not that simple. Cloudflare Workers support source maps but they only work in their dashboard, not in runtime. For Actions plugins, ncc can build source maps however I've never tested if it works out of the box when using the logger.

Reference:

The source map is retrieved after your Worker invocation completes — it's an asynchronous process that does not impact your Worker's CPU utilization or performance. Source maps are not accessible inside the Worker at runtime, if you console.log() the stack property ↗ within a Worker, you will not get a deobfuscated stack trace.

@0x4007
Copy link
Member Author

0x4007 commented Feb 6, 2025

Then lets make that sourcemap requirement optional if you can't figure it out.

@whilefoo
Copy link
Member

whilefoo commented Feb 6, 2025

Then lets make that sourcemap requirement optional if you can't figure it out.

I've tested and it doesn't work with Actions plugins even when source maps are generated. Based on some more research it seems that you have to parse source maps on your own. It's only natively supported by browsers and Node.js debugging tool.
I think it should be handled in the logger repo because it's a bigger task on its own

@0x4007
Copy link
Member Author

0x4007 commented Feb 6, 2025

Okay you can file the spec

Copy link

ubiquity-os-beta bot commented Feb 6, 2025

 [ 400 WXDAI ] 

@whilefoo
Contributions Overview
ViewContributionCountReward
IssueTask1400
Conversation Incentives
CommentFormattingRelevancePriorityReward

 [ 129.792 WXDAI ] 

@0x4007
Contributions Overview
ViewContributionCountReward
ReviewBase Review for #137125
ReviewCode Review23.56
IssueSpecification168.12
IssueComment514.376
ReviewComment418.736
Review Details for #137
ChangesPriorityReward
+36 -4743.32
+3 -340.24
Conversation Incentives
CommentFormattingRelevancePriorityReward
I also don’t understand why the function name is parsed as “asyn…
13.19
content:
  content:
    p:
      score: 0
      elementCount: 2
    ul:
      score: 0
      elementCount: 1
    li:
      score: 0.5
      elementCount: 5
    hr:
      score: 0
      elementCount: 1
    em:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 7.5
regex:
  wordCount: 116
  wordValue: 0.1
  result: 5.69
1468.12
@whilefoo please set a time label.
0.46
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.541.16
Also this error shouldn't occur on UI assignment. Only with /sta…
0.88
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 13
  wordValue: 0.1
  result: 0.88
144.48
Not a bad estimate I would have put <4 hours. Maybe we can st…
1.7
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.544.16
Then lets make that sourcemap requirement optional if you can't …
0.94
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 14
  wordValue: 0.1
  result: 0.94
0.843.904
Okay you can file the spec
0.46
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.340.672
https://github.com/ubiquibot-whilefoo-testing/testing/issues/18#…
5
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 0
  wordValue: 0.1
  result: 0
0.142.388
One more nitpick but would be great if you can line break betwee…
6.59
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 26
  wordValue: 0.1
  result: 1.59
0.3410.272
Missed opportunity for a 3xx level message whatever we agreed th…
1.95
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 33
  wordValue: 0.1
  result: 1.95
0.242.016
needs changes in sdk?skipfixedskipNot sure if it only runs o…
1.7
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 28
  wordValue: 0.1
  result: 1.7
0.544.06

 [ 22.74 WXDAI ] 

@gentlementlegen
Contributions Overview
ViewContributionCountReward
IssueComment222.74
Conversation Incentives
CommentFormattingRelevancePriorityReward
The user deleted their comments, you can see from the metadata t…
2.45
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 43
  wordValue: 0.1
  result: 2.45
0.546.18
Part of this issue was actually contained within another issue: …
6.44
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 23
  wordValue: 0.1
  result: 1.44
0.5416.56

@0x4007
Copy link
Member Author

0x4007 commented Feb 6, 2025

Okay you can file the spec

Also we need this @whilefoo

@rndquu rndquu removed this from Development Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants