ZnConstants missing 511 in default Pharo 6.0 32 image?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ZnConstants missing 511 in default Pharo 6.0 32 image?

Tim Mackinnon
Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).

Is there some problem in the build process, or is this some type of user error?

Tim
Reply | Threaded
Open this post in threaded view
|

Re: ZnConstants missing 511 in default Pharo 6.0 32 image?

Sven Van Caekenberghe-2
Hi Tim,

> On 27 Jun 2017, at 15:50, Tim Mackinnon <[hidden email]> wrote:
>
> Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
> It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).
>
> Is there some problem in the build process, or is this some type of user error?
>
> Tim

You should get

  ZnStatusLine code: 511. "a ZnStatusLine(511 Network Authentication Required)"

If that is not the case, do

  ZnConstants initialize.

What does ZnConstants class>>#initialize look like for you ?

The latest version should read like

initialize
        "Forced source code change for automatic initialization: 20170510"
       
        self initializeHTTPStatusCodes

Sven
Reply | Threaded
Open this post in threaded view
|

Re: ZnConstants missing 511 in default Pharo 6.0 32 image?

Juraj Kubelka
In reply to this post by Tim Mackinnon
Hi,

I remember that Sven did some changes related to the constants in about month or two months ago. But, I do not think that it was integrated to the Pharo 6 release.

Juraj

> El 27-06-2017, a las 15:50, Tim Mackinnon <[hidden email]> escribió:
>
> Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
> It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).
>
> Is there some problem in the build process, or is this some type of user error?
>
> Tim


Reply | Threaded
Open this post in threaded view
|

Re: ZnConstants missing 511 in default Pharo 6.0 32 image?

Sven Van Caekenberghe-2

> On 27 Jun 2017, at 16:02, Juraj Kubelka <[hidden email]> wrote:
>
> Hi,
>
> I remember that Sven did some changes related to the constants in about month or two months ago. But, I do not think that it was integrated to the Pharo 6 release.

Yeah, we forgot to put that in, it (the changed #initialize) is only in Zn #bleedingEdge.

The simplest patch for Pharo 6 would be to execute

  ZnConstants initialize.

A full Zn sync would be too much I think.

> Juraj
>
>> El 27-06-2017, a las 15:50, Tim Mackinnon <[hidden email]> escribió:
>>
>> Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
>> It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).
>>
>> Is there some problem in the build process, or is this some type of user error?
>>
>> Tim
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ZnConstants missing 511 in default Pharo 6.0 32 image?

Tim Mackinnon
In reply to this post by Sven Van Caekenberghe-2
Yes ZnConstants initialize
Works,

When I inspected the constants before this, it seemed to have everything except 511 (the last one).

Is there a load error in Pharo - as if the initialise code is correct, and the images are built with a CI process - I’m wondering how it gets into that state?

Tim

> On 27 Jun 2017, at 15:02, Sven Van Caekenberghe <[hidden email]> wrote:
>
> Hi Tim,
>
>> On 27 Jun 2017, at 15:50, Tim Mackinnon <[hidden email]> wrote:
>>
>> Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
>> It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).
>>
>> Is there some problem in the build process, or is this some type of user error?
>>
>> Tim
>
> You should get
>
>  ZnStatusLine code: 511. "a ZnStatusLine(511 Network Authentication Required)"
>
> If that is not the case, do
>
>  ZnConstants initialize.
>
> What does ZnConstants class>>#initialize look like for you ?
>
> The latest version should read like
>
> initialize
> "Forced source code change for automatic initialization: 20170510"
>
> self initializeHTTPStatusCodes
>
> Sven


Reply | Threaded
Open this post in threaded view
|

Re: ZnConstants missing 511 in default Pharo 6.0 32 image?

Sven Van Caekenberghe-2

> On 27 Jun 2017, at 18:30, Tim Mackinnon <[hidden email]> wrote:
>
> Yes ZnConstants initialize
> Works,
>
> When I inspected the constants before this, it seemed to have everything except 511 (the last one).
>
> Is there a load error in Pharo - as if the initialise code is correct, and the images are built with a CI process - I’m wondering how it gets into that state?

When a class is loaded, class side #initialize methods are run (so classes are re-initialized) if their source code changed (compared to what is already in the image). When 511 was added, the #initialize did not change, hence it was not run. That is why I currently add a comment like "Forced source code change for automatic initialization: 20170510" where I change the date when needed.

> Tim
>
>> On 27 Jun 2017, at 15:02, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> Hi Tim,
>>
>>> On 27 Jun 2017, at 15:50, Tim Mackinnon <[hidden email]> wrote:
>>>
>>> Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
>>> It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).
>>>
>>> Is there some problem in the build process, or is this some type of user error?
>>>
>>> Tim
>>
>> You should get
>>
>> ZnStatusLine code: 511. "a ZnStatusLine(511 Network Authentication Required)"
>>
>> If that is not the case, do
>>
>> ZnConstants initialize.
>>
>> What does ZnConstants class>>#initialize look like for you ?
>>
>> The latest version should read like
>>
>> initialize
>> "Forced source code change for automatic initialization: 20170510"
>>
>> self initializeHTTPStatusCodes
>>
>> Sven
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ZnConstants missing 511 in default Pharo 6.0 32 image?

Tim Mackinnon
Ah - I see. Is this where the minimal images would help? As in CI would just take a base image and just load zn  and hence run the new initialise anyway and so avoid this?

I'm a bit confused how how base images are built to even have this problem
In a world of CI?

Tim

Sent from my iPhone

> On 27 Jun 2017, at 17:55, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 27 Jun 2017, at 18:30, Tim Mackinnon <[hidden email]> wrote:
>>
>> Yes ZnConstants initialize
>> Works,
>>
>> When I inspected the constants before this, it seemed to have everything except 511 (the last one).
>>
>> Is there a load error in Pharo - as if the initialise code is correct, and the images are built with a CI process - I’m wondering how it gets into that state?
>
> When a class is loaded, class side #initialize methods are run (so classes are re-initialized) if their source code changed (compared to what is already in the image). When 511 was added, the #initialize did not change, hence it was not run. That is why I currently add a comment like "Forced source code change for automatic initialization: 20170510" where I change the date when needed.
>
>> Tim
>>
>>> On 27 Jun 2017, at 15:02, Sven Van Caekenberghe <[hidden email]> wrote:
>>>
>>> Hi Tim,
>>>
>>>> On 27 Jun 2017, at 15:50, Tim Mackinnon <[hidden email]> wrote:
>>>>
>>>> Hi - I have been slowly working my way through some of the pharo components and tutorials and when trying out ZnEasy with a password protected api, I got a talkback  when I mistyped a password.
>>>> It looks like ZnConstants in a fresh Pharo 6.0 32 image excludes 511 from its constants. The code looks correct (and its defined in the initialize method - ) but when I tried a ZnEasy call which returned 511 I got a walkback showing it as an unrecognized code? (The walkback is looking for 511 in ZnConstants httpStatusCodes).
>>>>
>>>> Is there some problem in the build process, or is this some type of user error?
>>>>
>>>> Tim
>>>
>>> You should get
>>>
>>> ZnStatusLine code: 511. "a ZnStatusLine(511 Network Authentication Required)"
>>>
>>> If that is not the case, do
>>>
>>> ZnConstants initialize.
>>>
>>> What does ZnConstants class>>#initialize look like for you ?
>>>
>>> The latest version should read like
>>>
>>> initialize
>>>    "Forced source code change for automatic initialization: 20170510"
>>>    
>>>    self initializeHTTPStatusCodes
>>>
>>> Sven
>>
>>
>
>