diff --git a/TransportGUN.js b/TransportGUN.js index f79d443..b8fc9ac 100644 --- a/TransportGUN.js +++ b/TransportGUN.js @@ -25,13 +25,15 @@ let defaultoptions = { // TODO-GUN - copy example from systemctl here /* - WORKING AROUND GUN WEIRNESS/SUBOPTIMAL (of course, whats weird/sub-optimal to me, might be ideal to someone else) + WORKING AROUND GUN WEIRNESS/SUBOPTIMAL (of course, whats weird/sub-optimal to me, might be ideal to someone else) - search the code to see where worked around WORKAROUND-GUN-UNDERSCORE .once() and possibly .on() send an extra GUN internal field "_" which needs filtering. Reported and hopefully will get fixed .once behaves differently on node or the browser - this is a bug https://github.com/amark/gun/issues/586 and for now this code doesnt work on Node WORKAROUND-GUN-CURRENT: .once() and .on() deliver existing values as well as changes, reported & hopefully will get way to find just new ones. WORKAROUND-GUN-DELETE: There is no way to delete an item, setting it to null is recorded and is by convention a deletion. BUT the field will still show up in .once and .on, WORKAROUND-GUN-PROMISES: GUN is not promisified, there is only one place we care, and that is .once (since .on is called multiple times). + WORKAROUND-GUN-ERRORS: GUN does an unhelpful job with errors, for example returning undefined when it cant find something (e.g. if connection to superpeer is down), + for now just throw an error on undefined Errors and Promises: Note that GUN's use of promises is seriously uexpected (aka weird), see https://gun.eco/docs/SEA#errors instead of using .reject or throwing an error at async it puts the error in SEA.err, so how that works in async parallel context is anyone's guess */ @@ -60,11 +62,10 @@ class TransportGUN extends Transport { /* TODO-GUN need to determine what a "rooted" Url is in gun, is it specific to a superpeer for example Utility function to get Gun object for this URL (note this isn't async) - url: URL string to find list of of form [gun|dweb]:/gun//[//
[/