-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMS Parsing #19
Comments
So you're saying that we should check the message length right before calling the SMSCore? You're right, we should think of a way to have the parser check for maximum length or set a maximum message content length because this parameter depends on the strategy. |
Yes, I mean, if the message is at exactly max length when being constructed and the parser is then called to actually send it, the header is added and causes it to overflow the length limit |
I'll write down my question here since I don't want to open another issue on parsing: Why are we including parsing of messages in smslibrary? The only purpose of this library is sending and receiving messages to and from certain peers, and I remember professor Peserico telling us that if we don't have a reason to include some feature at a low level, we should let higher levels handle that. In our case higher levels would be our killer-app or our dictionary, which would use smslibrary just to receive and send messages. Also, Unicode char Finally, in the documentation of SMSMessageHandler I'm reading expressions like "parses to" or "parses into", but there's no such thing as "parsing to" or "parsing into". Parsing a String means analyzing it and finding the tokens we need. |
As far as I can tell "parsing" has been there since day one to distinguish sms messages sent by our library from messages coming from other sources, we just didn't give it a name, are we supposed to get rid of it all? If we were to literally only send and receive messages we could trim the library down to four classes. Besides, having introduced the ability to set a parsing strategy the user is able to quickly set the strategy to just "send messages with no header and receive any message" with like two lines of code. |
As a matter of fact, we could change the default strategy to exactly that, and let the user add a header or whatever else if he wishes |
I agree, deciding if and what header to use should be done by the application using the library |
Well, then if we want to let the user set the strategy easily, the parsing procedure should remain imo, the issue of getting it to behave properly remains |
About the hidden character and the grammar error with the parsing verb you're right about both |
@albertoursino pointed out in Cogno-Marco/killer-app#18 (comment) that we need a check for a special character in the app too, in order to differentiate between messages sent to different apps using the same library and installed on the same phone (killer-app and network-dictionary), which makes a check in the library pointless. Technically the check is used by the application by implementing its own EDIT: nevermind, a class for parsing being present in the library doesn't prevent people from doing whatever they want in the app. I just think the default strategy shouldn't check for the special character. |
Regarding the maximum length of messages: I think Doing the check in A simple solution could be removing class |
@CremaLuca this is a bug, could you set the label appropriately? |
The parser and therefore the strategy is called only right before the call to SMSCore, which means the SMSMessage length check is rendered useless, because parseData just takes the String and adds the header, while parseMessage removes the header and builds an SMSMessage. Shouldn't it be the opposite?
The text was updated successfully, but these errors were encountered: