message caching #326

Merged
sarah merged 6 commits from cache into trunk 4 months ago
dan commented 4 months ago
Owner
  • message caching now caches all fetched messages, by id, localIndex, and contenthash where possible

needs:

- message caching now caches all fetched messages, by id, localIndex, and contenthash where possible needs: - https://git.openprivacy.ca/cwtch.im/libcwtch-go/pulls/64 - https://git.openprivacy.ca/cwtch.im/cwtch/pulls/424
dan added 3 commits 4 months ago
dan changed title from message caching to WIP message caching 4 months ago
dan added 1 commit 4 months ago
589bc4c36c new lcg; cleanup
dan changed title from WIP message caching to message caching 4 months ago
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/489
sarah reviewed 4 months ago
sarah left a comment

formatting

this.messageCache.insert(0, MessageCache(MessageMetadata(profileOnion, conversation, messageID, timestamp, senderHandle, senderImage, "", {}, false, false, isAuto), data));
this.totalMessages += 1;
}
void newMessage(int identifier, int messageID, DateTime timestamp, String senderHandle, String senderImage, bool isAuto, String data, String? contenthash, bool selectedConversation) {
sarah commented 4 months ago
Poster
Owner

why doesn't this notify listeners?

why doesn't this notify listeners?
dan marked this conversation as resolved
dan added 1 commit 4 months ago
889d398343 add notifyListen to newMessage in contact; format
sarah requested changes 4 months ago
Future<Message> messageHandler(BuildContext context, String profileOnion, int conversationIdentifier,
{bool byIndex = false, int? index, bool byID = false, int? id, bool byHash = false, String? hash}) {
var malformedMetadata = MessageMetadata(profileOnion, conversationIdentifier, 0, DateTime.now(), "", "", "", <String, String>{}, false, true, false);
if (!byIndex && !byID && !byHash) {
sarah commented 4 months ago
Poster
Owner

Use an enum to have the compiler do this check

Use an enum to have the compiler do this check
dan marked this conversation as resolved
EnvironmentConfig.debugLog("Error calling messageHandler: one of byIndex, byID, byHash must be set");
return Future.value(MalformedMessage(malformedMetadata));
}
if ((byID && id == null) || (byIndex && index == null) || (byHash && hash == null)) {
sarah commented 4 months ago
Poster
Owner

Use types to have the compiler enforce this coupling

Use types to have the compiler enforce this coupling
dan marked this conversation as resolved
dan added 1 commit 4 months ago
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/491
sarah approved these changes 4 months ago
sarah merged commit d0fecbd545 into trunk 4 months ago

Reviewers

sarah approved these changes 4 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as d0fecbd545.
Sign in to join this conversation.
Loading…
There is no content yet.