v12
v12 copied to clipboard
[BUG] some updated_at columns are never updated
Describe the bug
Some tables contain created_at
and updated_at
columns. Values for those columns are set during insertion but updated_at
is never changed upon updates.
There are probably some tables that only contain those two columns in order to be able to sort on the created_at
column. In this case, we could probably ignore updating updated_at
.
Here are some tables that we should update properly:
Table Names |
---|
srv_channel_users |
strategy_<X> |
To Reproduce Steps to reproduce the behavior:
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<script src="http://localhost:3000/assets/modules/channel-web/inject.js"></script>
<script>
window.botpressWebChat.init({
host: "http://localhost:3000",
botId: "test"
});
window.addEventListener("message", (event) => {
if (event.data && event.data.name === "webchatLoaded") {
window.botpressWebChat.mergeConfig({
layoutWidth: "100%",
userId: 'abcdeffd'
});
window.botpressWebChat.sendEvent({ type: "show" });
}
});
</script>
</body>
</html>
- Copy the HTML code above into an index.html file
- Start Botpress 12.26.7+
- Make sure that the botId exists
- Open the file in any browser
- Check the newly added column in
srv_channel_users
- Edit the userId and then refresh the page
- The attributes in
srv_channel_users
will be updated but not theupdated_at
column
Expected behavior This column should be updated.
Environment (please complete the following information):
On pretty much any version of Botpress
Ah... attribute methods just don't update the field.. it should.