Different user experience in Wix editor’s preview mode and a published site?

Trying to build a site with search functionality, I experience an interesting site behaviour. To be specific, the search results are different in Wix editor’s preview mode comparing those on the published site. In the code I have written, the search criteria are applied to the data of the third column. Since two entries in this column have the same name (i.e. ‘itemb’), the search result should give two items. This is the case in Wix editor’s preview mode, but when I try it outside of the preview mode on the published site the result only shows one item.


fig1: database


fig2: preview mode with two items


fig3: published site with only one item

As a second issue, I am trying to give users a message saying “No such an entry”, when their entered data is not in the database. Somehow, I have managed to do that, at least in the Wix editor’s preview mode. However, on the published site the message doesn’t show up.


fig4: the message “No such an entry” which only shows up in preview mode

I am wondering why these happen?

My code is as the following

import wixData from 'wix-data';
$w.onReady(function () {
//TODO: write your page related code here...
});

let debounceTimer;
export function input1_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#input1').value, );
}, 200);
}
let lastFilterTitle;
function filter(entry) {
if (lastFilterTitle !== entry) {
$w('#dataset1').setFilter(wixData.filter().eq('entry', entry)).then(() => {
$w("#repeater1").show()
lastFilterTitle = entry;
});
} else {
$w('#dataset1').setFilter(wixData.filter().eq('entry', "No such an entry"))
.then(() => {
$w("#repeater1").show()
lastFilterTitle = entry;
})
}

}

Maybe you forgot to sync from the collection sandbox to the live collection.

Or maybe the user permissions of the database have to do, when you edit it, you are usually admin when you exit the edit mode you do not have an administrator account and some things do not work well without those permissions.

As J.D. mentioned the very behaviour was a result of not syncing the database collection. I never thought I should do that since I hadn’t changed the dataset before.
Regarding the user permission which Carlos mentioned, I checked that and it wasn’t the cause, at least, in my case.
Thank you all for your guides and helps.
There is another thing that I would like to mention here and ask for your tips. For any entry that is not in my database, when I press the Enter button one time the message “No such and entry” does not show up in the repeater, but when I press another time the message is displayed in the repeater. You know, it is kind of cool, actually. Because it is like human behaviour as when you ask people a question, they might not want to react to your question in the first place, but when you keep asking, they turn and react to your question.
I am wondering is that because of some Wix coding or the code I have written and I am not aware of that. If the last one is the case, could you please say which part of the code causes this?

This behavior is due to your code logic.
According to your code, “No such entry”displays if and only if the current search input equals to the previous search input.