Remove stupid cycling UUID scheme. Instead, limit server-side pin deduping to a single instance.

This commit is contained in:
Ian Gulliver
2014-05-27 14:54:16 -07:00
parent 43dec31217
commit d96c31abf7
2 changed files with 4 additions and 3 deletions

View File

@@ -230,6 +230,7 @@ class Subject(db.Model):
Pin.all()
.ancestor(subject)
.filter('sender_message_id =', sender_message_id)
.filter('instance =', instance)
.fetch(1))
if pins:
raise DuplicateMessage(sender_message_id)

View File

@@ -403,9 +403,10 @@ Cosmopolite.prototype.pin = function(subject, message) {
*/
Cosmopolite.prototype.unpin = function(id) {
return new Promise(function(resolve, reject) {
var pin = this.pins_[id];
var args = {
'subject': this.pins_[id]['subject'],
'sender_message_id': id,
'subject': pin['subject'],
'sender_message_id': pin['sender_message_id'],
};
delete this.pins_[id];
@@ -768,7 +769,6 @@ Cosmopolite.prototype.onReconnect_ = function() {
for (var id in this.pins_) {
/** @type {typeMessage} */
var pin = this.pins_[id];
pin['sender_message_id'] = this.uuid_();
rpcs.push({
'command': 'pin',
'arguments': pin,