deso-protocol / frontend

DeSo frontend
MIT License
266 stars 135 forks source link

Notifications - please add date/time to all notifications (Feature request) #103

Open marshj1977 opened 3 years ago

marshj1977 commented 3 years ago

As per title - please add date/time to all notifications.

Because notifications don't always load up properly (e.g. node syncing) it is a pain to see which notifications are new, or when they were posted.

Surely it must be possible to get the date & time of all notifications to display on the notification panel.

Please consider - its my no 1 issue at the moment :)

Thanks guys.

p.s. Please don't take any of my posts as negatives, i'm just trying to help with constructive criticism and enhance the platform.

atyazin commented 3 years ago

Here's a possible solution I mocked up.

image
marshj1977 commented 3 years ago

that would help - but i would REALLY like to see date/time - even if for cleanness that meant adding your "hours ago" bit with a tooltip of the exact date time)

(although how tooltip would work on mobile is another issue)

tijno commented 3 years ago

This is not a straightforward solution and requires changes to the blockchain as far as I can see to implement.

The only transaction that stores a timestap (postContent.TimestampNanos in this case) is submit post.

The others dont.

If you have an idea of how to get around this, please share.

marshj1977 commented 3 years ago

@tijno - I've not had a chance to dig into the firehose, but if we know the datetime of the surrounding "submit post"s, can we not workout the (at least approximate) datetime of the transactions between based on index?

I'd have to consider it more and look closer myself, but would think that there are now enough submit posts to be able to get reasonably accurate with the times of other transaction types between (?).

Ideally, would like to see timestamp (or probably better instant) added to chain for every transaction type so that its easy to determine.

tijno commented 3 years ago

Anything is possible - but it may just be too intensive to do. If it was straightforward the devs would have done it - so they must have made the decision at that time to not add the info with a workaround.

Also - they could store timestamp with every transaction. But a timestamp takes up 9 bytes i guess. Theres 26m transactions already. That 250Mb of data that has to be stored in the block chain of everything that has happened in the past.

marshj1977 commented 3 years ago

indeed.

instant would probably be best option, think that's 8bytes - but yes would increase overall size.

Could possibly log a regular transaction with a fixed instant, then store a smaller value (e.g. short, 2bytes, based on previous instant + seconds since) for transactions after that to then allow time to be calculated without hugely increasing overall size (although its a given that it would increase). Majority of transactions only increase by 2 bytes then.

don't know much about crypto, so just throwing my thoughts out there before i actually look at it!

tijno commented 3 years ago

Yeah same as you - this is where my knowledge ends of what is possible or not. Additional additional transactions feels wasteful, and to lookup two transactions may be too intensive.

Maybe the block time is available for each transaction? If so - that could be used here to prepare the notification data.

https://github.com/bitclout/backend/blob/90cb5e88879160fee7b2ff0c0259c8273ec3deda/routes/user.go#L1899