This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
How to clear browser local stored data? #2005
Closed
Description
- Version: 0.34.4
- Platform: browser
- Subsystem: files
Type: Question
Severity: Low
Description:
I want to clear some of the data stored in the browser by ipfs, preventing excessive data usage and causing possible exceptions. But the ipfs.repo.gc
interface is not implemented, then I use ipfs.files.rm
, but how do I change it?
For example, I want to delete QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk
and all leaf nodes, call ipfs.files.rm('/ipfs/QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk', {recursive: true})
will report an error.
Steps to reproduce the error:
> await ipfs.files.stat('/ipfs/QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk', {withLocal: true})
{
blocks: 0,
cumulativeSize: 107507,
hash: "QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk",
local: undefined,
size: 107493,
sizeLocal: undefined,
type: "file",
withLocality: false
}
> await ipfs.files.rm('/ipfs/QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk', {recursive: true})
rm.js:59 Uncaught (in promise) Error: /ipfs/QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk does not exist Error: /ipfs/QmZdXoMy8Gvis99qmGtHH4Q8YaUTwZrC5G7hRiLcMwrnVk does not exist
at waterfall (rm.js:58)
at nextTask (waterfall.js:16)
at next (waterfall.js:23)
at onlyOnce.js:12
at toTrail (rm.js:52)
at reduce.js:10
at drain.js:20
at map.js:19
at filter.js:17
at map.js:19
Metadata
Metadata
Assignees
Labels
No labels