I can use the following ES6 code(worked in chrome) to reproduce this problem in the console of this app.
Note: The app has 200 fields.
function update() {
return new Promise((resovle, reject) => {
var body = {
"requests": [
{
"method": "POST",
"api": "/k/v1/record.json",
"payload": {
"app": 12746,
"record": {
"積地結合": {
"value": "testdata"
},
"配車担当者名": {
value: "奥野"
}
}
}
},
]
};
kintone.api(kintone.api.url('/k/v1/bulkRequest', true), 'POST', body, function (resp) {
//success
console.log("Bulk request success");
resovle("Update success");
}, function (error) {
//error
console.log(error);
reject("Update error");
});
});
}
async function query() {
return new Promise((resovle, reject) => {
var query = '(配車担当者名 like "奥野") order by 配車担当者名 asc, 積日 asc, レコード番号 asc limit 500 offset 0';
kintone.api(kintone.api.url('/k/v1/records', true) + '?app=12746&query=' + query, 'GET', {}, function (resp) {
// success
console.log("Requery record count " + resp.records.length);
resovle("OK");
}, function (error) {
// error
console.log(error);
reject("Error");
});
});
}
async function delay(ms) {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log("Delay " + ms + " millisecond")
resolve("Delay");
}, ms);
});
}
async function test1() {
await query();
await update();
await query();
}
async function test2() {
await query();
await update();
await delay(2000);
await query();
}
test1();
// Requery record count 56
// Bulk request success
// Requery record count 56 (It is wrong, it should 57)
//test2();
// query record count 57
// Bulk request success
// Delay 2000 millisecond
// Requery record count 58 (It is right, it is the correct result)