roam-unofficial / roam-toolkit

Roam force multiplier
MIT License
475 stars 43 forks source link

Fix sidebar panels fail to connect to each other occasionally (maybe has to do with emojis in titles?) #182

Closed tntmarket closed 3 years ago

tntmarket commented 3 years ago

I ran into a bug where a certain sidebar page wasn't forking new pages off of it. Opened links just were just disconnected. It only happened when forking from that particular sidebar page though.

I narrowed it down to Cytoscape mistakenly thinking that the edge had already been drawn. (It refuses to draw a duplicate edge in this case).

When I checked for the duplicate edge in the debugger, I saw that the Cytoscape filter was selecting the incorrect edges:

// Try to look for edges from Foo -> Bar
this.cy.$(`edge[source = "Foo"][target = "Bar"]`).target().id() // "Baz"
// It found an edge that didn't even go to Bar

It might've had something to emojis being in the title. I switched it to explicitly filtering and comparing ids, which seemed to fix the problem.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication