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

Function parseJsonToRawMap needs edition #671

Closed
letoribo opened this issue Jan 2, 2025 · 9 comments · Fixed by #678
Closed

Function parseJsonToRawMap needs edition #671

letoribo opened this issue Jan 2, 2025 · 9 comments · Fixed by #678
Assignees
Labels
bug Something isn't working

Comments

@letoribo
Copy link

letoribo commented Jan 2, 2025

Describe the bug
When adding nodes in Neo4j errors occur if these lines are not commented out:
https://github.com/hypermodeinc/modus/blob/main/sdk/assemblyscript/src/assembly/dynamicmap.ts#L126-L128
https://github.com/hypermodeinc/modus/blob/main/sdk/assemblyscript/src/assembly/dynamicmap.ts#L187-L189

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'modus discord'
  2. Open browser console 'Local Storage' 'https://discord.com'
  3. Enter in the filter field 'token'
  4. Copy token value and paste it to MODUS_DISCORD_TOKEN="..." in environment variables
  5. Open function https://github.com/letoribo/rhino/blob/main/assembly/index.ts#L52 in graphql explorer
  6. Set channel_id "1292948253796466730" and execute discord2Neo function
  7. See error

Expected behavior
All messages should be added to the database.

Videos

[videos.](https://discord.com/channels/1267579648657850441/1292948253796466730/1323674653688074320, https://discord.com/channels/1267579648657850441/1292948253796466730/1324464313519570976))

Environment

  • OS: [WSL Ubuntu]
  • Language [AssemblyScript]
  • Version [0.27.31]

Additional context
Some messages from Discord not being added to Neo4j.
The same in Python works as expected

@letoribo letoribo added the bug Something isn't working label Jan 2, 2025
@JairusSW
Copy link
Member

JairusSW commented Jan 3, 2025

@jairad26 I can take a look at this if you want

@jairad26
Copy link
Member

jairad26 commented Jan 3, 2025

yea that'd be great @JairusSW ty

@jairad26 jairad26 assigned JairusSW and unassigned jairad26 Jan 3, 2025
@JairusSW
Copy link
Member

JairusSW commented Jan 4, 2025

@letoribo, i'll go ahead and fix this.
fyi, DynamicMap is more of a patch for JairusSW/as-json#98, so it'll eventually work natively as part of the json library. So, you'll eventually just use Map<string, JSON.Raw> instead

@JairusSW
Copy link
Member

JairusSW commented Jan 4, 2025

@letoribo, i'll have this merged and tested by EOD on Monday

@letoribo
Copy link
Author

letoribo commented Jan 5, 2025

here is another issue:
getContent
an extra key appears and the value is split.
the same when getting nodes from Neo4j:
https://discord.com/channels/1267579648657850441/1292948253796466730/1324318763780280330

@letoribo
Copy link
Author

letoribo commented Jan 5, 2025

if someone noticed a "typo" in my code
https://github.com/letoribo/rhino/blob/main/assembly/index.ts
then in fact there is another issue behind it

@letoribo
Copy link
Author

letoribo commented Jan 6, 2025

letoribo/rhino@46ee674#diff-682acd9c5a77f612609c859ab1a0f7819d13e142ed6cae9597e937295691ccf5R87

Key does not exist at ~lib/map.ts:105:17

2025-01-06.12-29-25.mp4

image

@JairusSW
Copy link
Member

JairusSW commented Jan 6, 2025

@letoribo, thanks, i'll track the other issue down in a moment. Pushing out the json parsing bug first

I also just noticed that the parseJsonToRawMap function was AI generated😣

@JairusSW
Copy link
Member

JairusSW commented Jan 6, 2025

@letoribo, tested the first issue you had and its working now with the aforementioned PR. I'll get that merged in a moment. In the meantime, you could use something like https://www.npmjs.com/package/patch-package

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

Successfully merging a pull request may close this issue.

4 participants