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

PE-7146: fix(list drive/folders) #359

Conversation

thiagocarvalhodev
Copy link
Contributor

@thiagocarvalhodev thiagocarvalhodev commented Nov 21, 2024

  • Upgraded core-js to version 2.0.7.
  • Fix: Skip files with missing required properties when mounting folders or drives.

Steps to Reproduce the Current Issue

  1. Run the command:
ardrive list-folder -F c49f4153-ef99-45b8-a23a-a2fa725a1e7b
  1. Observe the following error:
Error: Invalid file state

Fix Behavior

Files with missing required properties, such as dataContentType, will now be skipped with a warning instead of throwing an error. Example:

Error building file. Skipping... Error: InvalidFileStateException: Invalid file state. Missing required properties: dataContentType

This allows the process to complete successfully, even when some files are malformed.

Complete output for the previous command

Error building file. Skipping... Error: InvalidFileStateException: Invalid file state. Missing required properties: dataContentType
[
    {
        "appName": "ArDrive-App",
        "appVersion": "2.57.0",
        "arFS": "0.14",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "folder",
        "name": "My Drive",
        "txId": "B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw",
        "unixTime": 1730895678,
        "customMetaDataGqlTags": {
            "App-Platform": "Web"
        },
        "parentFolderId": "root folder",
        "entityId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "folderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "path": "/My Drive",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266"
    },
    {
        "appName": "ArDrive-App",
        "appVersion": "2.57.2",
        "arFS": "0.14",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "file",
        "name": "file ",
        "txId": "beztK_S54-xKl52vJQwXUpDaVW3-raetlKB1ymn4rwc",
        "unixTime": 1732030123,
        "customMetaDataGqlTags": {
            "App-Platform": "Web"
        },
        "size": 14,
        "lastModifiedDate": 1731676540066,
        "dataTxId": "g0L7cqbyeNb7-TNWV660OQS_WikmChYKgivW3AZt5oU",
        "dataContentType": "application/octet-stream",
        "parentFolderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "entityId": "4567ee36-ac5a-47d4-b5ed-b618ef5cebbb",
        "fileId": "4567ee36-ac5a-47d4-b5ed-b618ef5cebbb",
        "path": "/My Drive/file ",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw/beztK_S54-xKl52vJQwXUpDaVW3-raetlKB1ymn4rwc",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266/4567ee36-ac5a-47d4-b5ed-b618ef5cebbb"
    },
    {
        "appName": "ArDrive-App",
        "appVersion": "2.57.2",
        "arFS": "0.14",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "file",
        "name": "image.png",
        "txId": "GJOoFCtsmcSCp3tesNriyfIFTXnkiYUnbd2o4y4Et2k",
        "unixTime": 1732105780,
        "customMetaDataGqlTags": {
            "App-Platform": "Web"
        },
        "customMetaDataJson": {
            "thumbnail": {
                "variants": [
                    {
                        "name": "small",
                        "txId": "fH4Pxb98ADb8BM2SUjip9VJRaEQWAjf04uZPp-r4XCQ",
                        "size": 3474,
                        "height": 32,
                        "width": 32
                    }
                ]
            }
        },
        "size": 1294,
        "lastModifiedDate": 1722427102864,
        "dataTxId": "pYrOdfAkttFN8wf62shROurK59JFcDxy5CUyXIWyCTs",
        "dataContentType": "image/png",
        "parentFolderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "entityId": "d07fc2a9-f2a9-4d86-9f13-81c07387e6ff",
        "fileId": "d07fc2a9-f2a9-4d86-9f13-81c07387e6ff",
        "path": "/My Drive/image.png",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw/GJOoFCtsmcSCp3tesNriyfIFTXnkiYUnbd2o4y4Et2k",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266/d07fc2a9-f2a9-4d86-9f13-81c07387e6ff"
    },
    {
        "appName": "ArDrive-App",
        "appVersion": "2.57.1",
        "arFS": "0.14",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "file",
        "name": "manifest_test",
        "txId": "_49fpA4-GuKUNo9RaX1f03o26Y58NndG7e7auPdBcHc",
        "unixTime": 1732110580,
        "customMetaDataGqlTags": {
            "App-Platform": "Web"
        },
        "size": 312,
        "lastModifiedDate": 1732110580855,
        "dataTxId": "wh4OMWtvxbUHKBu99t6n5SpwDkVAJFUvYnCzUkHJbYg",
        "dataContentType": "application/x.arweave-manifest+json",
        "parentFolderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "entityId": "d4f6d187-e681-438c-a104-495bb779b70c",
        "fileId": "d4f6d187-e681-438c-a104-495bb779b70c",
        "path": "/My Drive/manifest_test",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw/_49fpA4-GuKUNo9RaX1f03o26Y58NndG7e7auPdBcHc",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266/d4f6d187-e681-438c-a104-495bb779b70c"
    },
    {
        "appName": "ArDrive-CLI",
        "appVersion": "2.0.6",
        "arFS": "0.11",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "file",
        "name": "metadata",
        "txId": "yXOisyaVR5U7xTkMR6Q6To_Ka9qsXIyohfx7rJUgeUw",
        "unixTime": 1732214753,
        "size": 280,
        "lastModifiedDate": 1732214752,
        "dataTxId": "oW4OUxEr-aJKH8K1QfooKunoy0d44iYuQX2aFBSubDc",
        "dataContentType": "application/x.arweave-manifest+json",
        "parentFolderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "entityId": "7983e880-5954-4d16-85e7-a1ff7730b085",
        "fileId": "7983e880-5954-4d16-85e7-a1ff7730b085",
        "path": "/My Drive/metadata",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw/yXOisyaVR5U7xTkMR6Q6To_Ka9qsXIyohfx7rJUgeUw",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266/7983e880-5954-4d16-85e7-a1ff7730b085"
    },
    {
        "appName": "ArDrive-App",
        "appVersion": "2.57.1",
        "arFS": "0.14",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "file",
        "name": "sddsdsdsdsdsdssds",
        "txId": "gP1oEWUGP8laB-yJ-Fhyr2JY83nBIz2uTp9U_yEDzto",
        "unixTime": 1731876665,
        "customMetaDataGqlTags": {
            "App-Platform": "Web"
        },
        "customMetaDataJson": {
            "isHidden": false,
            "assignedNames": [
                "penaforte"
            ],
            "thumbnail": null
        },
        "size": 1114,
        "lastModifiedDate": 1730897101000,
        "dataTxId": "AdFPURQ8Hw1PrTaXNiiU_HsZknq3pDOz_2jk1dWjYAg",
        "dataContentType": "unknown",
        "parentFolderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "entityId": "a7c210fd-ee06-4a46-97b0-dfb0c8889d92",
        "fileId": "a7c210fd-ee06-4a46-97b0-dfb0c8889d92",
        "path": "/My Drive/sddsdsdsdsdsdssds",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw/gP1oEWUGP8laB-yJ-Fhyr2JY83nBIz2uTp9U_yEDzto",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266/a7c210fd-ee06-4a46-97b0-dfb0c8889d92"
    },
    {
        "appName": "ArDrive-App",
        "appVersion": "2.57.1",
        "arFS": "0.14",
        "contentType": "application/json",
        "driveId": "0a6d397d-70da-4da2-a593-a94d1456b0e5",
        "entityType": "file",
        "name": "testM.json",
        "txId": "qQ8O7CLWD9uZfrLXTvyyNQaO0MeR_-8qQGcS-kFZ2PE",
        "unixTime": 1732110576,
        "customMetaDataGqlTags": {
            "App-Platform": "Web"
        },
        "customMetaDataJson": {
            "licenseTxId": "ZLVR98DQTYquh9UemRgjEEZzhOJyMHy-KaXQTxgKVC4"
        },
        "size": 652,
        "lastModifiedDate": 1732104314559,
        "dataTxId": "ZLVR98DQTYquh9UemRgjEEZzhOJyMHy-KaXQTxgKVC4",
        "dataContentType": "application/x.arweave-manifest+json",
        "parentFolderId": "8679406b-dd5b-4360-82a5-40ca98d77266",
        "entityId": "eca86134-7d06-4d0f-8d70-f05d28e5f9c6",
        "fileId": "eca86134-7d06-4d0f-8d70-f05d28e5f9c6",
        "path": "/My Drive/testM.json",
        "txIdPath": "/B2kPnQnxPxa--p-l-eBrQ0IanV1Ugf9KER8WpXoq0Lw/qQ8O7CLWD9uZfrLXTvyyNQaO0MeR_-8qQGcS-kFZ2PE",
        "entityIdPath": "/8679406b-dd5b-4360-82a5-40ca98d77266/eca86134-7d06-4d0f-8d70-f05d28e5f9c6"
    }
]

- Upgrades core-js to 2.0.7
- Files with missing properties are now skipped when mounting the folder or drive
@thiagocarvalhodev thiagocarvalhodev self-assigned this Nov 21, 2024
@thiagocarvalhodev thiagocarvalhodev merged commit a920ed6 into master Nov 21, 2024
1 check passed
@thiagocarvalhodev thiagocarvalhodev deleted the PE-7146-skip-files-missing-data-content-type-while-listing-folders-and-drives branch November 21, 2024 19:08
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

Successfully merging this pull request may close these issues.

2 participants