Git Product home page Git Product logo

Comments (13)

bernharduw avatar bernharduw commented on June 23, 2024 1

PR #282 seems to solve that issue in a very simple way, by adding the rowIndex to the results. It enables us to sort manually at least. Merging that PR would at least make a workaround possible.

from gatsby-source-airtable.

jbolda avatar jbolda commented on June 23, 2024

Opening a new issue is perfect πŸ‘ . Thanks for digging into this. I am not necessarily intent on keeping Bluebird (as annoying as it is to remove it, add it, and then remove it again).

I have two thoughts on this which might be worth having a discussion with core maintainers. Can we expect that nodes created in a certain order will be returned in that same order when queried? I think this was the case before we added the async considerations. If that is something we should not depend on (now or in the future), we may need to add a way to sort the rows. Second is regarding the limits of downloading remote things in general. I wonder if it may be worth exploring (if it is even possible) adding this functionality to the core gatsby-source-filesystem function createRemoteFileNode to limit to number of concurrent downloads.

@pieh, I don't suppose I can bug you for your input on the above paragraph?

from gatsby-source-airtable.

christopherjbaker avatar christopherjbaker commented on June 23, 2024

I was able to resolve this myself with the following changes. Would you accept a PR of this?

Import both map and mapSeries from bluebird: const { map: mapParallel, mapSeries } = require('bluebird');
Use mapSeries when concurrency is 1, maintaing the current functionality for other cases: const map = concurrency === 1 ? mapSeries : mapParallel;

from gatsby-source-airtable.

jbolda avatar jbolda commented on June 23, 2024

I like that. Would love a PR with that πŸ‘ . I think it's still worthwhile to add the row number on the node for sorting or special filtering, but that can be a separate PR.

from gatsby-source-airtable.

zomars avatar zomars commented on June 23, 2024

Is this still active?

from gatsby-source-airtable.

jbolda avatar jbolda commented on June 23, 2024

@zomars are you wondering if this is still an issue?

from gatsby-source-airtable.

zomars avatar zomars commented on June 23, 2024

Yes. I mean, the data is still fetched in the wrong order. I've tried to apply @christopherjbaker 's fix with no luck still.

from gatsby-source-airtable.

jbolda avatar jbolda commented on June 23, 2024

I suspect with all the async within this plugin and downstream in Gatsby core that it will be difficult to rely on any order. I do believe that we get a row id from our Airtable query though they could be used.

It seems it hasn't been enough of a pain point for someone to work on a PR though. Happy to accept PRs πŸ˜„

from gatsby-source-airtable.

github-actions avatar github-actions commented on June 23, 2024

This issue has been automatically marked as stale because it has not had any recent activity for 30 days. It will be closed if no further activity occurs within 7 days. Remove stale label, comment, and/or apply "ongoing issue" label to prevent this from being closed. Thank you for your contributions.

from gatsby-source-airtable.

maxmammia avatar maxmammia commented on June 23, 2024

Why is this closed?

from gatsby-source-airtable.

github-actions avatar github-actions commented on June 23, 2024

This issue has been automatically marked as stale because it has not had any recent activity for 30 days. It will be closed if no further activity occurs within 7 days. Remove stale label, comment, and/or apply "ongoing issue" label to prevent this from being closed. Thank you for your contributions.

from gatsby-source-airtable.

wahidshafique avatar wahidshafique commented on June 23, 2024

PR #282 seems to solve that issue in a very simple way, by adding the rowIndex to the results. It enables us to sort manually at least. Merging that PR would at least make a workaround possible.

To add to this, you can also add an automation that reindexes on change. I did this

// change these names to pick a view:
let table = base.getTable('Levels');
let view = table.getView('Grid view');
let result = await view.selectRecordsAsync({ fields: [table.getField("Index")] });
let i = 0, len = result.records.length;
while (i < len) {
    const record = result.records[i]
    const cellIndex = record.getCellValue("Index")
    i += 1
    const expectedIndex = i
    if (record && cellIndex !== expectedIndex) {
        // we dont want this to run when the indices are matched, save a few millisecs
        await table.updateRecordAsync(record, {
            'Index': expectedIndex,
        });
    }
}

from gatsby-source-airtable.

jbolda avatar jbolda commented on June 23, 2024

Closing as it seems to have been address in #282.

from gatsby-source-airtable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.