Auto drive BUG submission

Auto drive BUG submission

On the Mainnet network
When there is a problem with the auto SDK. The files downloaded by auto drive may encounter errors

This TXT content should be 8888888

Unable to recognize after downloading

helloworld4.txt (10 Bytes)

Tested twice with no issues with uploading and previewing. But after uploading through web pages or SDK APIs. The txt text may contain errors.

Hi uuliao,

Thanks for reporting this issue, we were able to replicate it and we’ve already fixed in this PR. We’ll need some time (< 2 days) until this is merged and deployed.

Meanwhile this is a posible workaround you can use if needed.

I assume that this is how it looks you current code:

import { createAutoDriveApi } from '@autonomys/auto-drive'

const autoDrive = createAutoDriveApi({
  apiKey: '<api-key>',
  network: NetworkId.MAINNET,
})


const file = await autoDrive.downloadFile(
  'bafkr6ia2b2qaofvaw2nwucfnzbtog7le75ocra5jbtph2cwmrm6joiot5e',
)

With a simple tweak you should be able to download it correctly:

import { apiCalls, createAutoDriveApi } from '@autonomys/auto-drive'

const autoDrive = createAutoDriveApi({
  apiKey: '<api-key>',
  network: NetworkId.MAINNET,
})


const stream = await apiCalls.downloadObject(autoDrive, {
    cid: 'bafkr6ia2b2qaofvaw2nwucfnzbtog7le75ocra5jbtph2cwmrm6joiot5e',
    ignoreBackendEncoding: false,
})

Note that this workaround would work for unencrypted files since backend decoding is disabled for any encrypted file.

Let me know if I could help with something else or you have further questions about this workaround. Thanks for contributing!

1 Like

good I won’t make any urgent modifications. I will wait for 2 days. See the results after submission. If I download from ai3.storage normally. It means there’s no problem.

2 Likes

Hi uuiliao,

We managed to get it solved earlier than expected, it’s already live. Let me know if you need something else.

Thanks again for you help!

Downloading through the website is still incorrect. Did they not update?

Hi uuliao,

We use the indexedDB navigator interface for caching locally files so that is probably the root cause of the issue. Here are a instruction in how to wipe out the local cache:

Using Browser Settings (Chrome):

  • Open Settings: Go to Chrome’s settings (three dots in the top right > Settings).

  • Navigate to Privacy and Security: Select “Privacy and security” from the left-hand menu.

  • Content Settings / Site Settings: Click on “Site Settings” or “Content Settings”.

  • All Cookies and Site Data: Choose “View permissions and data stored across sites” or “All cookies and site data”.

  • Find and Remove: Search for the domain associated with the IndexedDB data you want to remove, and then click the “X” or “Remove” button next to it.

I have cleared the cache. However, the webpage download is currently unavailable. Always downloading

For an insurmountable obstacle. I waited for 5 days! Maybe my time doesn’t matter to others. But for me, every day is my life. So in order not to waste my life, please allow me to lose the courtesy of respecting others. And go to speak foul!

Hi uuliao,

You were using the “Delete browsing data“ option instead of “Content Settings” or “Site Settings“ that I suggested in my previous comment. Anyways, I managed to invalidate the file cache remotely so you should be good to go now.

OK, the download has now been successful.