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

Step meta.cursor not correctly outputting current byte correctly when using parser.pause() 5.3.2 #1054

Open
eeeBs opened this issue May 22, 2024 · 0 comments

Comments

@eeeBs
Copy link

eeeBs commented May 22, 2024

Currently running v5.3.2 due to the CSV parsing being broken in 5.4.1 #998

Is anyone else able to reproduce this?

       const stepLogic = (results: any, parser: any) => {
            parser.pause();
            setTimeout(() => {
                parser.resume();
            }, 50)
            const size = parser.streamer._config.size
            console.log('Current Position is: ' + results.meta.cursor + ', Filesize is ' + size)
        }
        Papa.parse(fileData, {
            header: true,
            size,
            chunkSize: 500,  // Set chunkSize per recommendation
            step: stepLogic,
        }); 

which gets me an output of

Current Position is: 1289, Filesize is 2562317
Current Position is: 1275, Filesize is 2562317
Current Position is: 1364, Filesize is 2562317
Current Position is: 1289, Filesize is 2562317
Current Position is: 1303, Filesize is 2562317
Current Position is: 1295, Filesize is 2562317
Current Position is: 1357, Filesize is 2562317
Current Position is: 1313, Filesize is 2562317
Current Position is: 1328, Filesize is 2562317
Current Position is: 1281, Filesize is 2562317
Current Position is: 1293, Filesize is 2562317
Current Position is: 1285, Filesize is 2562317
Current Position is: 1282, Filesize is 2562317
Current Position is: 1301, Filesize is 2562317
Current Position is: 1267, Filesize is 2562317
Current Position is: 1277, Filesize is 2562317
Current Position is: 1323, Filesize is 2562317
Current Position is: 1395, Filesize is 2562317
Current Position is: 1358, Filesize is 2562317
Current Position is: 1334, Filesize is 2562317
Current Position is: 1308, Filesize is 2562317
Current Position is: 1289, Filesize is 2562317
Current Position is: 1302, Filesize is 2562317
Current Position is: 1289, Filesize is 2562317
Current Position is: 1296, Filesize is 2562317
Current Position is: 1286, Filesize is 2562317
Current Position is: 1343, Filesize is 2562317

Pretty sure this should be working, but maybe I am misunderstanding something?

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

1 participant