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

chore(tile-converter): create SLPK hash during serve #2565

Merged
merged 4 commits into from
Jul 26, 2023

Conversation

dariaterekhova-actionengine
Copy link
Collaborator

No description provided.

@@ -12,3 +12,4 @@ import './zip-utils/data-view-provider.spec';
import './zip-utils/cd-file-header.spec';
import './zip-utils/local-file-header.spec';
import './search-from-the-end.spec';
import './end-of-dentral-directory.spec';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import './end-of-dentral-directory.spec';
import './end-of-central-directory.spec';

}
let hashData: HashElement[];
if (cdFileHeader?.fileName !== '@specialIndexFileHASH128@') {
cb?.("SLPK doesn't contain hash file");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix warning

import {ZipSignature, searchFromTheEnd} from './search-from-the-end';
import {SLPKArchive} from './slpk-archieve';
import {searchFromTheEnd} from '../parse-zip/search-from-the-end';
import {HashElement, SLPKArchive, compareHashes} from './slpk-archieve';

/**
* Creates slpk file handler from raw file
* @param fileProvider raw file data
* @returns slpk file handler
*/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line between comment and function

Comment on lines 148 to 151
let data = await this.getFileBytes(path);
if (!data) {
data = await this.getFileBytes(path.toLocaleLowerCase());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datasets made by spec should work faster. As lowercase is by spec so it should work faster. I'd suggest to seek it first. If search by spec is not working the code will try to find it in another way.
Point it out in the comment with reference to the spec.

@@ -9,6 +10,8 @@ export type ZipCDFileHeader = {
compressedSize: bigint;
/** Uncompressed size */
uncompressedSize: bigint;
/** Extra field size size */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misprint?

Suggested change
/** Extra field size size */
/** Extra field size */

CD_LOCAL_HEADER_OFFSET_OFFSET: 42n,
CD_FILE_NAME_OFFSET: 46n
};
): Promise<ZipCDFileHeader | undefined> => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined is not a good type to return it explicitly. null is better

Suggested change
): Promise<ZipCDFileHeader | undefined> => {
): Promise<ZipCDFileHeader | null> => {

Buffer.from(signature)
) !== 0
) {
return Promise.resolve(undefined);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Promise.resolve(undefined);
return null;


/**
* Parses end of central directory record of zip file
* @param fileProvider - buffer containing whole array
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work only with array or with file handle as well?

Suggested change
* @param fileProvider - buffer containing whole array
* @param fileProvider - FileProvider instance

slpkArchive = await parseSLPK(await FileHandleProvider.from(fullLayerPath), (msg) =>
console.log(msg)
);
console.log('Server ready to use');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log('Server ready to use');
console.log('The server is ready to use');

@dariaterekhova-actionengine dariaterekhova-actionengine deleted the dt/no-hash-slpk branch July 26, 2023 10:12
@dsavinov-actionengine dsavinov-actionengine added the ActionEngine The issue is on ActionEngine controll label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ActionEngine The issue is on ActionEngine controll
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants