Skip to content

getAll handler is currently broken and needs fixing.  #610

@addievo

Description

@addievo

Describe the bug

The NodesGetAll handler needs to be fixed. I did a monkey patch while testing and it needs to be applied to Polykey.

// client/handlers/NodesgetAll.ts

for await (const [index, bucket] of nodeGraph.getBuckets()) {
            for (const [id, info] of bucket) {
                const encodedId = nodesUtils.encodeNodeId(id);
                // For every node in every bucket, add it to our message
                if (ctx.signal.aborted)
                    throw ctx.signal.reason;
                yield {
                    bucketIndex: index,
                    nodeIdEncoded: encodedId,
                    host: info.address.host,
                    port: info.address.port,
                };
            }
        }

Originally posted by @tegefaulkes in MatrixAI/Polykey-CLI#44 (comment)

To Reproduce

  1. Run nodes getall in Polykey-CLI.

Expected behavior

Shouldn't throw an error and succeed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions