Skip to content

ipfs blockservice is incompatible with sessions #34

Open
@Jorropo

Description

@Jorropo

// Blockstore returns the underlying Blockstore.
func (nbs *BlockService) Blockstore() blockstore.Blockstore {
return nbs.bs.Blockstore()
}
// Exchange returns the underlying Exchange.
func (nbs *BlockService) Exchange() exchange.Interface {
return nbs.bs.Exchange()
}

See how the code does not apply any blocking on sessions.
Theses are used by boxo/blockservice.NewSession when a session is used.

This also cause issues with new ContextWithSession feature because it's not possible to unwrap a nopfs blockservice and access the real one underneath (so the context value key becomes the nopfs blockservice which isn't what we want because nopfs doesn't do session redirection based on context).

We should do blocking on the blockstore.Blockstore and exchange.Exchange API arguments before they are passed to the blockservice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions