Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip invalid chunks in getAllChunksInRegion #78

Open
zardoy opened this issue Jun 12, 2024 · 2 comments
Open

Skip invalid chunks in getAllChunksInRegion #78

zardoy opened this issue Jun 12, 2024 · 2 comments

Comments

@zardoy
Copy link
Contributor

zardoy commented Jun 12, 2024

Here:

chunks.push(this.load(x * 32 + _x, z * 32 + _z))

chunks are loaded but it is possible that chunk is not full and an exception will be thrown in this case. These chunks should be skipped (or at least there should be an option for this).

this line

const toRet = await Promise.all(chunks)

can be changed to (await Promise.allSettled(chunks)).filter(x => x.status === 'fulfilled').map(x => x.value)

Also, I wonder why the file is getting closed later

await region.file.close()

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

what is an invalid chunk? how can this happen? where is the bug that produces it?

@zardoy
Copy link
Contributor Author

zardoy commented Oct 30, 2024

what is an invalid chunk?

It can easily happen because of a broken file. Or if the file has a different format that we don't support yet

where is the bug that produces it?

Wdym? The region processing code can cause it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants