Merge tag '2.26.0.25'

pull/1/head
Matthew Chen 6 years ago
commit f8e785ef72

@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.26.0.24</string>
<string>2.26.0.25</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LOGS_EMAIL</key>

@ -442,12 +442,11 @@ typedef enum : NSUInteger {
// Cache the cell media for ~24 cells.
self.cellMediaCache.countLimit = 24;
[self.uiDatabaseConnection beginLongLivedReadTransaction];
// We need to update the "unread indicator" _before_ we determine the initial range
// size, since it depends on where the unread indicator is placed.
self.lastRangeLength = 0;
[self ensureDynamicInteractions];
[[OWSPrimaryStorage sharedManager] updateUIDatabaseConnectionToLatest];
if (thread.uniqueId.length > 0) {
self.messageMappings = [[YapDatabaseViewMappings alloc] initWithGroups:@[ thread.uniqueId ]

@ -22,6 +22,8 @@ extern NSString *const OWSUIDatabaseConnectionNotificationsKey;
@property (nonatomic, readonly) YapDatabaseConnection *dbReadConnection;
@property (nonatomic, readonly) YapDatabaseConnection *dbReadWriteConnection;
- (void)updateUIDatabaseConnectionToLatest;
+ (YapDatabaseConnection *)dbReadConnection;
+ (YapDatabaseConnection *)dbReadWriteConnection;

@ -170,10 +170,15 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
OWSAssertIsOnMainThread();
DDLogVerbose(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
[self updateUIDatabaseConnectionToLatest];
}
- (void)updateUIDatabaseConnectionToLatest
{
// Notify observers we're about to update the database connection
[[NSNotificationCenter defaultCenter] postNotificationName:OWSUIDatabaseConnectionWillUpdateNotification object:self.dbNotificationObject];
// Move uiDatabaseConnection to the latest commit.
// Do so atomically, and fetch all the notifications for each commit we jump.
NSArray *notifications = [self.uiDatabaseConnection beginLongLivedReadTransaction];
@ -184,7 +189,7 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
object:self.dbNotificationObject
userInfo:userInfo];
}
- (YapDatabaseConnection *)uiDatabaseConnection
{
OWSAssertIsOnMainThread();

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>2.26.0</string>
<key>CFBundleVersion</key>
<string>2.26.0.24</string>
<string>2.26.0.25</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSAppTransportSecurity</key>

Loading…
Cancel
Save