Christoph Thiede uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ct.1258.mcz
==================== Summary ====================
Name: System-ct.1258
Author: ct
Time: 27 November 2021, 10:12:41.787227 pm
UUID: 12ec7795-2256-144c-92c1-c8c412a4539e
Ancestors: System-ct.1257
Robustizes CI status badge query against server errors.
For a current example, see: https://www.githubstatus.com/incidents/r5qrpp2f5fc0
=============== Diff against System-ct.1257 ===============
Item was changed:
----- Method: SystemVersion>>ciStatusTimestamp (in category 'continuous integration') -----
ciStatusTimestamp
"Slow. Fetch HTML page, extract first occurrence of
... <time-ago datetime='2021-08-04T14:24:20Z' ... "
+ | statusResponse statusPage begin end dateAndTime |
+ statusResponse := WebClient httpGet: self ciStatusPageUrl.
+ statusResponse isSuccess ifFalse: [^ nil].
+ statusPage := statusResponse content.
- | statusPage begin end dateAndTime |
- statusPage := (WebClient httpGet: self ciStatusPageUrl) content.
begin := statusPage findString: 'datetime' startingAt: 100000. "Skip the first X bytes decoration."
end := statusPage findString: 'Z' startingAt: begin.
dateAndTime := DateAndTime readFrom: (statusPage copyFrom: begin + 10 to: end) readStream.
^ String streamContents: [:s |
dateAndTime asDate = Date today
ifTrue: [s nextPutAll: 'Today' translated, ',']
ifFalse: [dateAndTime asDate = Date yesterday
ifTrue: [s nextPutAll: 'Yesterday' translated, ',']
ifFalse: [dateAndTime printYMDOn: s]].
s space.
dateAndTime printHMSOn: s]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1426.mcz
==================== Summary ====================
Name: Kernel-eem.1426
Author: eem
Time: 27 November 2021, 1:02:15.155642 pm
UUID: 9ca49d5c-f988-4848-a26b-53b1f79d64a2
Ancestors: Kernel-ct.1425
Implement protection against infinite recursion of doesNotUnderstand: within Object>>doesNotUnderstand:.
Note: this implementation puts the additional error handler within Object>>doesNotUnderstand: and sends error: to the receiver on detecting recursion. An alternative might be to introduce a protected form of sentTo:, which would more naturally send error to the message. e.g. either of
Message methods for sending
sentWithProtectionAgainstRecursiveDoesNotUnderstandTo: receiver
"Answer the result of sending this message to receiver, within a guard to
protect against infinite recursion."
^[self sentTo: receiver]
on: MessageNotUnderstood
do: [:ex|
(receiver == ex receiver
and: [self hasIdenticalContentsAs: ex message]) ifTrue:
[receiver error: 'infinite recursion in doesNotUnderstand:'].
ex pass]
or
sentWithProtectionAgainstRecursiveDoesNotUnderstandTo: receiver
"Answer the result of sending this message to receiver, within a guard to
protect against infinite recursion."
^[self sentTo: receiver]
on: MessageNotUnderstood
do: [:ex|
(receiver == ex receiver
and: [self hasIdenticalContentsAs: ex message]) ifTrue:
[self error: 'infinite recursion in doesNotUnderstand:'].
ex pass]
I think this is too elaborate. Adding Message>>hasIdenticalContentsAs: is the key to making all variants concise enough.
=============== Diff against Kernel-ct.1425 ===============
Item was added:
+ ----- Method: Message>>hasIdenticalContentsAs: (in category 'comparing') -----
+ hasIdenticalContentsAs: aMessage
+ "Answer if the argument's selector and arguments are identically equal to those of the receiver.
+ It is assumed that the argument aMessage is, in fact, a message."
+ selector ~~ aMessage selector ifTrue:
+ [^false].
+ 1 to: args size do:
+ [:i| (args at: i) ~~ (aMessage arguments at: i) ifTrue: [^false]].
+ ^true!
Item was changed:
----- Method: Object>>doesNotUnderstand: (in category 'error handling') -----
doesNotUnderstand: aMessage
"Handle the fact that there was an attempt to send the given
message to the receiver but the receiver does not understand
this message (typically sent from the machine when a message
+ is sent to the receiver and no method is defined for that selector).
- is sent to the receiver and no method is defined for that selector)."
+ Raise the MessageNotUnderstood signal. If it is caught, answer
+ the result supplied by the exception handler. If it is not caught,
+ answer the result of resending the message within a guard for
+ infinite recursion. This allows, for example, the programmer to
+ implement the method and continue."
+
"Testing: (3 activeProcess)"
| exception resumeValue |
(exception := MessageNotUnderstood new)
message: aMessage;
receiver: self.
resumeValue := exception signal.
+ ^exception reachedDefaultHandler "i.e. exception was not caught..."
+ ifTrue:
+ [[aMessage sentTo: self]
+ on: MessageNotUnderstood
+ do: [:ex|
+ (self == ex receiver
+ and: [aMessage hasIdenticalContentsAs: ex message]) ifFalse:
+ [ex pass].
+ self error: 'infinite recursion in doesNotUnderstand:']]
- ^exception reachedDefaultHandler
- ifTrue: [aMessage sentTo: self]
ifFalse: [resumeValue]!
Christoph Thiede uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ct.1256.mcz
==================== Summary ====================
Name: System-ct.1256
Author: ct
Time: 27 November 2021, 9:01:15.105306 pm
UUID: 8dbc4b47-8812-2f45-a7bf-00eb0bf13360
Ancestors: System-ct.1255
Fixes a recent merge slip in MailSender.
=============== Diff against System-ct.1255 ===============
Item was changed:
----- Method: MailSender class>>userName (in category 'accessing') -----
userName
"Answer the user name to be used for sending out messages. Leave empty if authentication not required."
+ self isUserNameSet ifFalse: [self setUserName].
- self isUserNameSet ifNil: [self setUserName].
^UserName!
Item was changed:
----- Method: MailSender class>>userPassword (in category 'accessing') -----
userPassword
"Answer the user password to be used for sending out messages. Leave empty if authentication not required."
+ self isUserPasswordSet ifFalse: [self setUserPassword].
- self isUserPasswordSet ifNil: [self setUserPassword].
^ UserPassword!
Christoph Thiede uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-jar.250.mcz
==================== Summary ====================
Name: Network-jar.250
Author: jar
Time: 12 November 2021, 10:07:25.383788 pm
UUID: fe957845-b8bb-e143-8e58-e4e886f51bac
Ancestors: Network-eem.249
Allow No authentication SMTP login for an empty username (in addition to a nil username).
Currently, if the username is nil the AUTH LOGIN command won't be sent; however if the username is empty ('') the AUTH LOGIN will be sent and the server may not like it and return an error message. This behavior prevents Squeak Inbox Talk tool (ct) from using simple no auth SMTP server to send messages.
=============== Diff against Network-eem.249 ===============
Item was changed:
----- Method: SMTPClient>>login (in category 'private protocol') -----
login
"Send HELO first"
self initiateSession.
self user ifNil: [^self].
+ self user ifEmpty: [^self].
self sendCommand: 'AUTH LOGIN ' , (self encodeString: self user).
[self checkResponse]
on: TelnetProtocolError
do: [ :ex | ex isCommandUnrecognized ifTrue: [^ self] ifFalse: [ex pass]].
self sendCommand: (self encodeString: self password).
self checkResponse!
Christoph Thiede uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ct.1255.mcz
==================== Summary ====================
Name: System-ct.1255
Author: ct
Time: 27 November 2021, 8:53:55.970306 pm
UUID: a35e96f7-0507-3042-aaff-e79400904e49
Ancestors: System-mt.1254, System-ct.1253
Fixes the ancestry again (merges System-ct.1253). Sorry for the noise!
=============== Diff against System-mt.1254 ===============
Item was changed:
----- Method: MailSender class>>isUserNameSet (in category 'testing') -----
isUserNameSet
+ ^ UserName notNil!
- ^ UserName notNil and: [UserName notEmpty]
- !
Item was changed:
----- Method: MailSender class>>isUserPasswordSet (in category 'testing') -----
isUserPasswordSet
+ ^ UserPassword notNil!
- ^ UserPassword notNil and: [UserPassword notEmpty]
- !
Item was changed:
----- Method: MailSender class>>setUserName (in category 'settings') -----
setUserName
(UIManager default
request: 'What is your user name on the SMTP server?' withCRs
+ initialAnswer: (UserName ifNil: ['']))
- initialAnswer: (UserName ifNil: [UserName := '']))
ifNotNil: [:answer | UserName := answer]!
Item was changed:
----- Method: MailSender class>>userName (in category 'accessing') -----
userName
+ "Answer the user name to be used for sending out messages. Leave empty if authentication not required."
- "Answer the user name to be used for sending out messages."
+ self isUserNameSet ifNil: [self setUserName].
- self isUserNameSet ifFalse: [self setUserName].
-
- UserName isEmpty ifTrue: [ self error: 'no user name specified' ].
-
^UserName!
Item was changed:
----- Method: MailSender class>>userPassword (in category 'accessing') -----
userPassword
+ "Answer the user password to be used for sending out messages. Leave empty if authentication not required."
+ self isUserPasswordSet ifNil: [self setUserPassword].
- self isUserPasswordSet ifFalse: [self setUserPassword].
-
- UserPassword isEmpty ifTrue: [ self error: 'no user name specified' ].
-
^ UserPassword!