TasoOneAsia / t-notify

A FiveM wrapper for the SimpleNotification library. Click the link below for documentation.

Home Page:https://docs.tasoagc.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report] Message doesn't disappear

ikhalid24 opened this issue · comments

Version: 1.30

Description:
When I login to the server I encounter this problem and when writing a command: restart t-notify, it's will be fixed
images (FIX after restart t-notify): https://prnt.sc/v6ntkm
Images (Problem when I login to the server): https://prnt.sc/v6nrdj

Debug: https://prnt.sc/v6nt9u

Usage (Screenshot of your code):
My config code: https://prnt.sc/v6nrs3
Script code: https://prnt.sc/v6nsbu

Thank you so much .

Interesting is this a consistent issue that always occurs during any use of the resource?

Yes correct, the problem appears to me on all resources

I'll attempt to reproduce this issue shortly, thanks for the detailed report.

Alright so we are having these same issues on our server. I've taken screenshots of the iframe on both a non working and a working one to help:

Broken:
https://i.vgy.me/Zf6MPv.png

Working:
https://i.vgy.me/SbndWn.png

As you can see, animation-name is undefined when broken and animation-duration doesn't show at all. We've noticed that when it breaks, all notifications start spamming and sticking on the top left, where we have them aligned top-right

I haven't been able to reproduce this issue unfortunately, could you enable dev mode prints and also send those over.

Edit: Could you also post the code you are using to invoke this notification.

A full repro would also be quite helpful.

If you'd like to join a discord chat with me so I can share screen go ahead and add me: Gokaic#6866. I will try to put as much info as I can here.

I'm unable to join a voicechat but please place relevant information here as this could be corroborated by other individuals also experiencing this issue.

So a working dump of options shows the following:

nil{"position":"top-right","maxNotifications":0,"removeAllOnDisplay":false,"closeOnClick":true,"closeButton":true,"duration":5000,"sticky":false,"events":{},"insertAnimation":{"name":"insert-right","duration":1000},"removeAnimation":{"name":"fadeout","duration":600}} (@t-notify/nui/SimpleNotification/notification.js:730)

A broken version has the following:

nil{"removeAllOnDisplay":false,"closeOnClick":true,"closeButton":true,"duration":5000,"sticky":false,"events":{},"insertAnimation":{},"removeAnimation":{}} (@t-notify/nui/SimpleNotification/notification.js:730)

Both were passed the same information when called from static custom which was the following:

nil{"type":"noti","custom":true,"style":"scoreboard","message":" ![https://cdn.discordapp.com/attachments/471806098299682831/759857815422238780/unknown.png] \n\n--![https://cdn.discordapp.com/attachments/471806098299682831/758506939754741780/identifier.png] >>Gokaic Egaci (ID: 13)< -\n\n --![https://cdn.discordapp.com/attachments/471806098299682831/758506814596710440/ping.png]- Ping>>84<\n\n --![https://cdn.discordapp.com/attachments/471806098299682831/758506694548127804/online.png]- Players >>1/32<\n\n --![https://cdn.discordapp.com/attachments/471806098299682831/758506180225663006/job.png]- Gokaic's Job >>LAPD<","time":5000} (@t-notify/nui/assets/script.js:35)

We aren't able to reliably recreate this, as it seems random. It occurs mostly on player joining, and only after relogging or restarting the script will it fix, though we've had a few that had it happen randomly during playthrough.

Could you also provide a screenshot of the f8 console with the developer logging turned on in the config as well as the code invoking this notification.

The code is as follows:

exports['t-notify']:Custom(
{
style = 'scoreboard',
message = ' ![https://cdn.discordapp.com/attachments/471806098299682831/759857815422238780/unknown.png] \n\n--![https://cdn.discordapp.com/attachments/471806098299682831/758506939754741780/identifier.png] >>' .. info.first .. ' ' .. info.last .. ' (ID: ' .. GetPlayerServerId(NetworkGetEntityOwner(GetPlayerPed(-1))) .. ')< -\n\n --![https://cdn.discordapp.com/attachments/471806098299682831/758506814596710440/ping.png]- Ping>>' .. info.ping .. '<\n\n --![https://cdn.discordapp.com/attachments/471806098299682831/758506694548127804/online.png]- Players >>' .. #GetActivePlayers() .. '/32<\n\n --![https://cdn.discordapp.com/attachments/471806098299682831/758506180225663006/job.png]- ' .. info.first .. ''s Job >>' .. PlayerData.job.label .. '<',
duration = 5000,
custom = true
})

The images of F8:
4YY5X0.png
plFJGj.png

The F8 debug shows the same for working and not working

Are those the logs using the toggle in the config.lua because it doesn't seem to be the case.

yes those are from the debug being turned on

Here is a screenshot of the logs posted by Khalid. https://prnt.sc/v6nt9u. Your's are not like this.

Could it be because this is a custom notification?

No, they are all routed through the same logging section. Please join my discord so we can discuss this in further detail.

What is your discord. I'll contact you there tomorrow to work on it further

This bug seems to be caused by attempting to send a client notification event before the initialization is complete. To solve this issue please trigger notifications only after the initialization process is complete.

If you have found that this issue is still caused even after client initialization, please open a new issue.