changed the description
marked as a Work In Progress
changed the description
- Developer
Ok, I am going to need some help testing this one. Can you walk me through it?
- Developer
Can do if you like when we get to it. Just restructuring this component a bit at the moment as per Martins specification in our chat.
- Developer
The approvals aren't required for mobile-native but an extra pair of eyes is always welcomed.
changed milestone to %"sprint: Jolly Jellyfish"
unmarked as a Work In Progress
added MR::Awaiting Review Squad::Green scoped labels
- MaintainerResolved by Ben Hayward
Maybe we can move the decryption of the messages to the conversation store and run the decryption from the latest message to the oldest ones, once we hit the first decryption error we stop there and remove the other messages. In order to get the Messages re-rendered when the state change we should create a
MessageModel
with adecrypted
observable - Last reply by Ben Hayward
added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label
added 2 commits
resolved all threads
added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label
5 export default class MessageModel extends BaseModel { 6 7 @observable decrypted = false; 8 @observable friendly_ts = null; 9 @observable guid = null; 10 @observable message = null; 11 @observable messages = null; 12 @observable owner = null; 13 @observable ownerObj = null; 14 @observable owner_guid = null; 15 @observable rowKey = null; 16 @observable subtype = null; 17 @observable time_created = null; 18 @observable type = null; 19 @observable __list = null; 20 @observable decrypting = false; - Maintainer
Only decrypting and message should be observable. Also, I think that message doesn't have the property messages.
24 24 import crypto from '../../common/services/crypto.service'; 25 25 import Tags from '../../common/components/Tags'; 26 26 import i18n from '../../common/services/i18n.service'; 27 import MessageModel from '../MessageModel'; - Maintainer
this import is not needed
55 .then(msg => { 56 this.setState({ decrypted: true, msg }); 57 message.decrypted = true; 58 message.message = msg; 59 }); 60 } else { 61 message.decrypted = true; 62 message.message = ''; 63 this.setState({ decrypted: true, msg:'' }); 64 } 65 }, 0); 66 67 } else { 68 this.setState({ decrypted: true, msg: message.message }); 69 } 44 this.message = this.props.message; - Maintainer
there is no need for componentWillMount here, we can access the prop
this.props.message
directly in the render methodEdited by Martin Santangelo
61 62 this.moreData = false; 62 63 } 63 64 65 conversation.messages = MessageModel.createMany(conversation.messages.reverse()); 66 67 for (let i = 0; i < conversation.messages.length; i++) { 68 conversation.messages[i].decrypt(); - Maintainer
we should detect the decryption error and remove the older messages from there
added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label
- Developer
Had not seen your feedback here, my apologies Martin
- Developer
@brianhatchet @msantang78 do you want me to take care of this still or is it left in your hands?
closed