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

🐛 Bug: PK not saving properly when adding row through UI #8351

Closed
1 task done
k29fan opened this issue Apr 26, 2024 · 3 comments
Closed
1 task done

🐛 Bug: PK not saving properly when adding row through UI #8351

k29fan opened this issue Apr 26, 2024 · 3 comments

Comments

@k29fan
Copy link

k29fan commented Apr 26, 2024

Please confirm if bug report does NOT exist already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

  1. Make a new project
  2. From script, create a table with a PK with the following column fields:
headers = {
        "xc-auth": "auth here",
        "Content-Type": "application/json"
    }

url = "url here"

table = {"title": "test",
         "table_name": "test",
         "columns": [{
            "column_name": "PK",
            "title": "PK",
            "uidt": "SingleLineText",
            "dt": "character varying",
            "pk": 1
}]}

res = json.dumps(table)

print(requests.post(url, data=res, headers=headers).json())
  1. Try to add rows with new primary key values (Try adding 'Great Western Canada' and variations of it, it results in the UI showing shortened versions of what you entered)

Desired Behavior

To save each row properly

Project Details

Node: v16.19.1
Arch: x64
Platform: linux
Docker: true
RootDB: pg
PackageVersion: 0.108.1

Attachments

No response

@HassanShakerIsmail
Copy link

Was able to reproduce on same system - seems like an onkeyup listener event is firing too quickly during entry of data into pk column which causes premature upsert into db. Short text entries in pk column typed at moderate pace (such that listener event doesn't fire before you're done entering data) seems to avoid this issue.

i'm thinking nocodb's lack of being able to retroactively edit PK's coupled with the premature upsertion because of the listener event firing is causing data to be half uploaded depending on whatever the listener event saw at the time of firing.

Tables without a pk (and hence columns that can be retroactively edited) seem to avoid the issue completely, can anyone else verify? Still new to nocodb so a little hesitant to trust my conclusion here..

@dstala
Copy link
Member

dstala commented May 15, 2024

fixed here
https://github.com/nocodb/nocohub/commit/b6adcab79f1f33f5638be8e470bde4f3ef1aca92

should be available in OSS in next release

@dstala dstala closed this as completed May 15, 2024
@HassanShakerIsmail
Copy link

fixed here https://github.com/nocodb/nocohub/commit/b6adcab79f1f33f5638be8e470bde4f3ef1aca92

should be available in OSS in next release

thanks for the quick work though
i think commit link is broken, any idea when next release might happen?

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

No branches or pull requests

3 participants