Comments

Looks very good! Can't wait to see it in action!
A few comments. I'll just cluster this in one ticket now:

I am not sure why there needs to be JSON at all. Doesn't it make things more complicated?:
upload.php - could simply return the url in plaintext or a normal HTTP error code + message on failure
activate.php - could have a normal POST parameter for the note id and the reply is not interesting for the client (=will not be parsed), perhaps if there is an error. The error could be a normal HTTP error code + message
Generally, it seems a little weird to get a HTTP OK 200 on an error

Posting raw data to upload the picture - is this normal? I thought it would be always multipart/form-data for file upload. Not sure if this changes anything.

file upload limit: I would very much like a configurable file upload limit. On my website, the maximum upload file size in PHP.ini is 128MB and I do not want to change the default there to something as low as would be a good setting for this service (a few MB)

Did you handle the case that a photo has already been moved from the tmp directory to the proper one? activate.php should in that case just return "OK", no error.

Did you handle the case that the to-be-activated new picture is in one of the note comments and earlier comments or the first post in the thread also had links which are now dead because the note had been redacted/closed in the meantime but reopened later? (activate.php should still return "OK" and activate just the new one, ignore the rest)

Photos of redacted notes should be cleaned up without considering MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS

How well does the service handle if I would go about deleting this and that image manually from the filesystem (without touching the DB)?

Why is the file extension saved to DB? (Because it is in the filesystem already). Hmm and actually, why is the id even saved to DB? - It's also in the name

For making the file name as short as possible, perhaps a-z could also be used to count-up the filename.

The service must be prepared to make all calls to the OSM Notes API with a logged in user, specifyable in the config. (because of GDPR / DSGVO the notes api will perhaps not be allowed to be used as anonymous)

What seems to be missing is that the cleanup script also starts deleting photos if the max directory size exceeds the configured limit (oldest first)

Finally, double check everything regarding not accepting parameters as-is from the user and preventing the possibility of a SQL injection?

Before answering to all the comments, let me transform this into a checklist, so I can keep track of it.

[ ] 1. Why JSON; error handling
[ ] 2. Posting raw data
[ ] 3. File upload limit
[ ] 4. Case that file has already been moved
[ ] 5. Case that multiple photo URLs are in note
[ ] 6. MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS is undesired
[ ] 7. Robustness regarding manual file deletion
[ ] 8. Why saving file id and extension in database
[ ] 9. Making file name even shorter
[ ] 10. Authenticated API calls
[ ] 11. Max directory size
[ ] 12. Checked against SQL injections and similar

Thanks, glad to hear that. Now let's talk about your comments.

I am not sure why there needs to be JSON at all. Doesn't it make things more complicated?:
upload.php - could simply return the url in plaintext or a normal HTTP error code + message on failure
activate.php - could have a normal POST parameter for the note id and the reply is not interesting for the client (=will not be parsed), perhaps if there is an error. The error could be a normal HTTP error code + message
Generally, it seems a little weird to get a HTTP OK 200 on an error

No very strong reason why I picked JSON, I just liked it. I can also just return plain text but having a structured output is better prepared if we ever want to return some other data in the future. Also, I wanted it to be consistent across the API. Regarding the HTTP status code: That should be properly set in all cases. Where do you get a 200 even if there is an error? It should always return a meaningful code. If not I have made a mistake and would like to fix that. Back to the JSON: Do you really require changes here? I imagined it wouldn't be too complex to extract a value from a JSON.

Posting raw data to upload the picture - is this normal? I thought it would be always multipart/form-data for file upload. Not sure if this changes anything.

Nah, multipart/form-data is only for data consisting of multiple fields, including files, that are uploaded via an HTML form. It introduces a certain overhead and involves a weird encoding. Additionally, the way I'm doing it here allows to hold the data in memory and only write it to disk when accepted. If you download a file, the content type will specify what data to except, the raw data will follow. It's exactly the same for uploads (except that the content type header should not be trusted). An API typically has no use for multipart encoding.

file upload limit: I would very much like a configurable file upload limit. On my website, the maximum upload file size in PHP.ini is 128MB and I do not want to change the default there to something as low as would be a good setting for this service (a few MB)

All right, I will implement this.

Did you handle the case that a photo has already been moved from the tmp directory to the proper one? activate.php should in that case just return "OK", no error.

I hope you mean moved by a previous call to activate.php not by you fiddling with the file system :D In the desired case it finds that the photo was already activated and returns HTTP code 200 along with something like {'found_photos': 1, 'activated_photos': 0}.

Did you handle the case that the to-be-activated new picture is in one of the note comments and earlier comments or the first post in the thread also had links which are now dead because the note had been redacted/closed in the meantime but reopened later? (activate.php should still return "OK" and activate just the new one, ignore the rest)

Yes, it does that. Leading to an HTTP code 200 and something like {'found_photos': 2, 'activated_photos': 1}.

Photos of redacted notes should be cleaned up without considering MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS

Really? Since notes are often reactivated within the first few days after they got closed, I think the photos could still be useful. But that's up to you. However, do you really want to have this removed? I mean the feature is already there and you can just set the constant to 0. (Actually I had in bug in that, but it is fixed now.)

How well does the service handle if I would go about deleting this and that image manually from the filesystem (without touching the DB)?

activate.php would return HTTP 500 with {'error': 'Cannot move file'} and abort. cleanup.php would print something like PHP Warning:  unlink(../photos_tmp/18.jpg): No such file or directory and go ahead. The corresponding database entry will only be deleted when it's due because of the currently implemented cleanup rules. Do you want that something different happens?

Why is the file extension saved to DB? (Because it is in the filesystem already). Hmm and actually, why is the id even saved to DB? - It's also in the name

Well, if I remove file_id and file_ext, the only columns left will be creation_time and note_id. Where is then the association between photo and note? Maybe it is possible to change everything in a way that the file name is solely extracted from the OSM note. But I think relying on information only available remotely is not so nice. Additionally, this would require more parsing and user-supplied input validation. I consider it easier and probably cleaner to do this how it currently happens. Is this a no-go for you?

For making the file name as short as possible, perhaps a-z could also be used to count-up the filename.

I have to say that I'm not excited about this. I thought about file name generation. At first I had 32 byte random values for collision free identification. But then I also had the opinion that short file names would be great. Therefore, I came up with just using the incremental primary key ID of the database entry. Changing this to also include other characters may be much more work to implement. The encoding would probably be needed to be done manually, if hex or base64 are not enough. Besides, the service works more or less based on the fact that the file has a numeric ID. I think several parts would need to change. And the current file names are not utterly long either. Is this change really important for you?

The service must be prepared to make all calls to the OSM Notes API with a logged in user, specifyable in the config. (because of GDPR / DSGVO the notes api will perhaps not be allowed to be used as anonymous)

Oh, yes. I will implement this.

What seems to be missing is that the cleanup script also starts deleting photos if the max directory size exceeds the configured limit (oldest first)

Right, as stated in the SC issue, this was deliberately omitted, because I was not sure if you really need this considering the amount of uploaded photos in the past. But since you seem to want that feature, I can implement it.

Finally, double check everything regarding not accepting parameters as-is from the user and preventing the possibility of a SQL injection?

Already did that. At least it is my job finding such vulnerabilities ;) But if I overlooked something, what certainly could happen, let me know immediately, so I can fix that.
That was much...

Regarding 6: there is a difference between closed (=resolved) notes and redacted (=hidden) notes. That the latter exist is a relatively new features and enables moderators to hide/censor spam or otherwise inappropriate content by completely hiding them from non-moderators. I am not sure about the Http code that is returned when querying a note like this by id - if 404 or something else
Am 30. August 2018 19:38:14 MESZ schrieb Jannik Vieten<EMAIL_ADDRESS>
Thanks, glad to hear that. Now let's talk about your comments.

I am not sure why there needs to be JSON at all. Doesn't it make
things more complicated?:
upload.php - could simply return the url in plaintext or a normal HTTP
error code + message on failure
activate.php - could have a normal POST parameter for the note id and
the reply is not interesting for the client (=will not be parsed),
perhaps if there is an error. The error could be a normal HTTP error
code + message
Generally, it seems a little weird to get a HTTP OK 200 on an error

No very strong reason why I picked JSON, I just liked it. I can also
just return plain text but having a structured output is better
prepared if we ever want to return some other data in the future. Also,
I wanted it to be consistent across the API. Regarding the HTTP status
code: That should be properly set in all cases. Where do you get a 200
even if there is an error? It should always return a meaningful code.
If not I have made a mistake and would like to fix that. Back to the
JSON: Do you really require changes here? I imagined it wouldn't be too
complex to extract a value from a JSON.

Posting raw data to upload the picture - is this normal? I thought
it would be always multipart/form-data for file upload. Not sure if
this changes anything.

Nah, multipart/form-data is only for data consisting of multiple
fields, including files, that are uploaded via an HTML form. It
introduces a certain overhead and involves a weird encoding.
Additionally, the way I'm doing it here allows to hold the data in
memory and only write it to disk when accepted. If you download a file,
the content type will specify what data to except, the raw data will
follow. It's exactly the same for uploads (except that the content type
header should not be trusted). An API typically has no use for
multipart encoding.

file upload limit: I would very much like a configurable file
upload limit. On my website, the maximum upload file size in PHP.ini is
128MB and I do not want to change the default there to something as low
as would be a good setting for this service (a few MB)

All right, I will implement this.

Did you handle the case that a photo has already been moved from
the tmp directory to the proper one? activate.php should in that case
just return "OK", no error.

I hope you mean moved by a previous call to activate.php not by you
fiddling with the file system :D In the desired case it finds that the
photo was already activated and returns HTTP code 200 along with
something like {'found_photos': 1, 'activated_photos': 0}.

Did you handle the case that the to-be-activated new picture is in
one of the note comments and earlier comments or the first post in the
thread also had links which are now dead because the note had been
redacted/closed in the meantime but reopened later? (activate.php
should still return "OK" and activate just the new one, ignore the
rest)

Yes, it does that. Leading to an HTTP code 200 and something like
{'found_photos': 2, 'activated_photos': 1}.

Photos of redacted notes should be cleaned up without considering
MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS

Really? Since notes are often reactivated within the first few days
after they got closed, I think the photos could still be useful. But
that's up to you. However, do you really want to have this removed? I
mean the feature is already there and you can just set the constant to
0. (Actually I had in bug in that, but it is fixed now.)

How well does the service handle if I would go about deleting this
and that image manually from the filesystem (without touching the DB)?

activate.php would return HTTP 500 with {'error': 'Cannot move file'} and abort. cleanup.php would print something like PHP Warning:  unlink(../photos_tmp/18.jpg): No such file or directory and
go ahead. The corresponding database entry will only be deleted when
it's due because of the currently implemented cleanup rules. Do you
want that something different happens?

Why is the file extension saved to DB? (Because it is in the
filesystem already). Hmm and actually, why is the id even saved to DB?

It's also in the name

Well, if I remove file_id and file_ext, the only columns left will
be creation_time and note_id. Where is then the association between
photo and note? Maybe it is possible to change everything in a way that
the file name is solely extracted from the OSM note. But I think
relying on information only available remotely is not so nice.
Additionally, this would require more parsing and user-supplied input
validation. I consider it easier and probably cleaner to do this how it
currently happens. Is this a no-go for you?

For making the file name as short as possible, perhaps a-z could
also be used to count-up the filename.

I have to say that I'm not excited about this. I thought about file
name generation. At first I had 32 byte random values for collision
free identification. But then I also had the opinion that short file
names would be great. Therefore, I came up with just using the
incremental primary key ID of the database entry. Changing this to also
include other characters may be much more work to implement. The
encoding would probably be needed to be done manually, if hex or base64
are not enough. Besides, the service works more or less based on the
fact that the file has a numeric ID. I think several parts would need
to change. And the current file names are not utterly long either. Is
this change really important for you?

The service must be prepared to make all calls to the OSM Notes
API with a logged in user, specifyable in the config. (because of GDPR
/ DSGVO the notes api will perhaps not be allowed to be used as
anonymous)

Oh, yes. I will implement this.

What seems to be missing is that the cleanup script also starts
deleting photos if the max directory size exceeds the configured limit
(oldest first)

Right, as stated in the SC issue, this was deliberately omitted,
because I was not sure if you really need this considering the amount
of uploaded photos in the past. But since you seem to want that
feature, I can implement it.

Finally, double check everything regarding not accepting
parameters as-is from the user and preventing the possibility of a SQL
injection?

Already did that. At least it is my job finding such vulnerabilities ;)
But if I overlooked something, what certainly could happen, let me know
immediately, so I can fix that.
That was much...

Regarding 7, it is just important that the service will not get into some kind of undefined or invalid state but keeps working as expected l. Noting missing pics as warnings is fine
Am 30. August 2018 19:38:14 MESZ schrieb Jannik Vieten<EMAIL_ADDRESS>
Thanks, glad to hear that. Now let's talk about your comments.

I am not sure why there needs to be JSON at all. Doesn't it make
things more complicated?:
upload.php - could simply return the url in plaintext or a normal HTTP
error code + message on failure
activate.php - could have a normal POST parameter for the note id and
the reply is not interesting for the client (=will not be parsed),
perhaps if there is an error. The error could be a normal HTTP error
code + message
Generally, it seems a little weird to get a HTTP OK 200 on an error

No very strong reason why I picked JSON, I just liked it. I can also
just return plain text but having a structured output is better
prepared if we ever want to return some other data in the future. Also,
I wanted it to be consistent across the API. Regarding the HTTP status
code: That should be properly set in all cases. Where do you get a 200
even if there is an error? It should always return a meaningful code.
If not I have made a mistake and would like to fix that. Back to the
JSON: Do you really require changes here? I imagined it wouldn't be too
complex to extract a value from a JSON.

Posting raw data to upload the picture - is this normal? I thought
it would be always multipart/form-data for file upload. Not sure if
this changes anything.

Nah, multipart/form-data is only for data consisting of multiple
fields, including files, that are uploaded via an HTML form. It
introduces a certain overhead and involves a weird encoding.
Additionally, the way I'm doing it here allows to hold the data in
memory and only write it to disk when accepted. If you download a file,
the content type will specify what data to except, the raw data will
follow. It's exactly the same for uploads (except that the content type
header should not be trusted). An API typically has no use for
multipart encoding.

file upload limit: I would very much like a configurable file
upload limit. On my website, the maximum upload file size in PHP.ini is
128MB and I do not want to change the default there to something as low
as would be a good setting for this service (a few MB)

All right, I will implement this.

Did you handle the case that a photo has already been moved from
the tmp directory to the proper one? activate.php should in that case
just return "OK", no error.

I hope you mean moved by a previous call to activate.php not by you
fiddling with the file system :D In the desired case it finds that the
photo was already activated and returns HTTP code 200 along with
something like {'found_photos': 1, 'activated_photos': 0}.

Did you handle the case that the to-be-activated new picture is in
one of the note comments and earlier comments or the first post in the
thread also had links which are now dead because the note had been
redacted/closed in the meantime but reopened later? (activate.php
should still return "OK" and activate just the new one, ignore the
rest)

Yes, it does that. Leading to an HTTP code 200 and something like
{'found_photos': 2, 'activated_photos': 1}.

Photos of redacted notes should be cleaned up without considering
MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS

Really? Since notes are often reactivated within the first few days
after they got closed, I think the photos could still be useful. But
that's up to you. However, do you really want to have this removed? I
mean the feature is already there and you can just set the constant to
0. (Actually I had in bug in that, but it is fixed now.)

How well does the service handle if I would go about deleting this
and that image manually from the filesystem (without touching the DB)?

activate.php would return HTTP 500 with {'error': 'Cannot move file'} and abort. cleanup.php would print something like PHP Warning:  unlink(../photos_tmp/18.jpg): No such file or directory and
go ahead. The corresponding database entry will only be deleted when
it's due because of the currently implemented cleanup rules. Do you
want that something different happens?

Why is the file extension saved to DB? (Because it is in the
filesystem already). Hmm and actually, why is the id even saved to DB?

It's also in the name

Well, if I remove file_id and file_ext, the only columns left will
be creation_time and note_id. Where is then the association between
photo and note? Maybe it is possible to change everything in a way that
the file name is solely extracted from the OSM note. But I think
relying on information only available remotely is not so nice.
Additionally, this would require more parsing and user-supplied input
validation. I consider it easier and probably cleaner to do this how it
currently happens. Is this a no-go for you?

For making the file name as short as possible, perhaps a-z could
also be used to count-up the filename.

I have to say that I'm not excited about this. I thought about file
name generation. At first I had 32 byte random values for collision
free identification. But then I also had the opinion that short file
names would be great. Therefore, I came up with just using the
incremental primary key ID of the database entry. Changing this to also
include other characters may be much more work to implement. The
encoding would probably be needed to be done manually, if hex or base64
are not enough. Besides, the service works more or less based on the
fact that the file has a numeric ID. I think several parts would need
to change. And the current file names are not utterly long either. Is
this change really important for you?

The service must be prepared to make all calls to the OSM Notes
API with a logged in user, specifyable in the config. (because of GDPR
/ DSGVO the notes api will perhaps not be allowed to be used as
anonymous)

Oh, yes. I will implement this.

What seems to be missing is that the cleanup script also starts
deleting photos if the max directory size exceeds the configured limit
(oldest first)

Right, as stated in the SC issue, this was deliberately omitted,
because I was not sure if you really need this considering the amount
of uploaded photos in the past. But since you seem to want that
feature, I can implement it.

Finally, double check everything regarding not accepting
parameters as-is from the user and preventing the possibility of a SQL
injection?

Already did that. At least it is my job finding such vulnerabilities ;)
But if I overlooked something, what certainly could happen, let me know
immediately, so I can fix that.
That was much...

Regarding 8: no, just asking. Specifically I wondered about the file extension.
Am 30. August 2018 19:38:14 MESZ schrieb Jannik Vieten<EMAIL_ADDRESS>
Thanks, glad to hear that. Now let's talk about your comments.

I am not sure why there needs to be JSON at all. Doesn't it make
things more complicated?:
upload.php - could simply return the url in plaintext or a normal HTTP
error code + message on failure
activate.php - could have a normal POST parameter for the note id and
the reply is not interesting for the client (=will not be parsed),
perhaps if there is an error. The error could be a normal HTTP error
code + message
Generally, it seems a little weird to get a HTTP OK 200 on an error

No very strong reason why I picked JSON, I just liked it. I can also
just return plain text but having a structured output is better
prepared if we ever want to return some other data in the future. Also,
I wanted it to be consistent across the API. Regarding the HTTP status
code: That should be properly set in all cases. Where do you get a 200
even if there is an error? It should always return a meaningful code.
If not I have made a mistake and would like to fix that. Back to the
JSON: Do you really require changes here? I imagined it wouldn't be too
complex to extract a value from a JSON.

Posting raw data to upload the picture - is this normal? I thought
it would be always multipart/form-data for file upload. Not sure if
this changes anything.

Nah, multipart/form-data is only for data consisting of multiple
fields, including files, that are uploaded via an HTML form. It
introduces a certain overhead and involves a weird encoding.
Additionally, the way I'm doing it here allows to hold the data in
memory and only write it to disk when accepted. If you download a file,
the content type will specify what data to except, the raw data will
follow. It's exactly the same for uploads (except that the content type
header should not be trusted). An API typically has no use for
multipart encoding.

file upload limit: I would very much like a configurable file
upload limit. On my website, the maximum upload file size in PHP.ini is
128MB and I do not want to change the default there to something as low
as would be a good setting for this service (a few MB)

All right, I will implement this.

Did you handle the case that a photo has already been moved from
the tmp directory to the proper one? activate.php should in that case
just return "OK", no error.

I hope you mean moved by a previous call to activate.php not by you
fiddling with the file system :D In the desired case it finds that the
photo was already activated and returns HTTP code 200 along with
something like {'found_photos': 1, 'activated_photos': 0}.

Did you handle the case that the to-be-activated new picture is in
one of the note comments and earlier comments or the first post in the
thread also had links which are now dead because the note had been
redacted/closed in the meantime but reopened later? (activate.php
should still return "OK" and activate just the new one, ignore the
rest)

Yes, it does that. Leading to an HTTP code 200 and something like
{'found_photos': 2, 'activated_photos': 1}.

Photos of redacted notes should be cleaned up without considering
MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS

Really? Since notes are often reactivated within the first few days
after they got closed, I think the photos could still be useful. But
that's up to you. However, do you really want to have this removed? I
mean the feature is already there and you can just set the constant to
0. (Actually I had in bug in that, but it is fixed now.)

How well does the service handle if I would go about deleting this
and that image manually from the filesystem (without touching the DB)?

activate.php would return HTTP 500 with {'error': 'Cannot move file'} and abort. cleanup.php would print something like PHP Warning:  unlink(../photos_tmp/18.jpg): No such file or directory and
go ahead. The corresponding database entry will only be deleted when
it's due because of the currently implemented cleanup rules. Do you
want that something different happens?

Why is the file extension saved to DB? (Because it is in the
filesystem already). Hmm and actually, why is the id even saved to DB?

It's also in the name

Well, if I remove file_id and file_ext, the only columns left will
be creation_time and note_id. Where is then the association between
photo and note? Maybe it is possible to change everything in a way that
the file name is solely extracted from the OSM note. But I think
relying on information only available remotely is not so nice.
Additionally, this would require more parsing and user-supplied input
validation. I consider it easier and probably cleaner to do this how it
currently happens. Is this a no-go for you?

For making the file name as short as possible, perhaps a-z could
also be used to count-up the filename.

I have to say that I'm not excited about this. I thought about file
name generation. At first I had 32 byte random values for collision
free identification. But then I also had the opinion that short file
names would be great. Therefore, I came up with just using the
incremental primary key ID of the database entry. Changing this to also
include other characters may be much more work to implement. The
encoding would probably be needed to be done manually, if hex or base64
are not enough. Besides, the service works more or less based on the
fact that the file has a numeric ID. I think several parts would need
to change. And the current file names are not utterly long either. Is
this change really important for you?

The service must be prepared to make all calls to the OSM Notes
API with a logged in user, specifyable in the config. (because of GDPR
/ DSGVO the notes api will perhaps not be allowed to be used as
anonymous)

Oh, yes. I will implement this.

What seems to be missing is that the cleanup script also starts
deleting photos if the max directory size exceeds the configured limit
(oldest first)

Right, as stated in the SC issue, this was deliberately omitted,
because I was not sure if you really need this considering the amount
of uploaded photos in the past. But since you seem to want that
feature, I can implement it.

Finally, double check everything regarding not accepting
parameters as-is from the user and preventing the possibility of a SQL
injection?

Already did that. At least it is my job finding such vulnerabilities ;)
But if I overlooked something, what certainly could happen, let me know
immediately, so I can fix that.
That was much...

Regarding 6: there is a difference between closed (=resolved) notes and redacted (=hidden) notes. That the latter exist is a relatively new features and enables moderators to hide/censor spam or otherwise inappropriate content by completely hiding them from non-moderators. I am not sure about the Http code that is returned when querying a note like this by id - if 404 or something else

Oh, for some reason I missed the word 'redacted' when reading your comment. I already implemented this at https://github.com/exploide/sc-photo-service/blob/master/cleanup.php#L23 I searched for such a note on the forums and it seems to be 410 Gone.

Regarding 7, it is just important that the service will not get into some kind of undefined or invalid state but keeps working as expected l. Noting missing pics as warnings is fine

The only thing I currently can imagine is that you want to activate a note with two (new) photo urls, the first one goes fine while the second one causes the error. The state of the service will not be inconsistent, but the response won't reflect that one photo got successfully activated while the other don't. You currently only see the 500.

Regarding 8: no, just asking. Specifically I wondered about the file extension.

Ok, great. The thing with the file extension is, that I would need to do something like file globbing if I wouldn't know the extension to complete the file name. This way I have everything at hand.

Regarding 9: no, not that important. Though, the shorter the better, and, hex IS numerical, isn't it?

Yes, this "only" would require a conversion when specifying either database ID or file name. But base 10 vs base 16 doesn't make a big difference in size. After one million photos you saved two characters. I propose keeping it as is for now. If this really becomes an issue we can do a relaunch or something like that :P

The missing features are implemented now.
You can authenticate against the OSM API if you like, but this is optional. This way you can leave username and password set to NULL until it becomes necessary.
Files are rejected during upload if the size is larger then the configured limit.
cleanup.php starts deleting old active photos when the configured limit is exceeded. Currently it won't delete much, only few files more than what's necessary to adhere to the limit. Additionally, this only affects active photos. Inactive photos are purged anyway after $MAX_TMP_LIFETIME_HOURS.
Now the only open points I have:
Is it fine keeping the JSON output?
Should something change concerning point 7 (manual deletion robustness) in contrast to what I wrote in https://github.com/exploide/sc-photo-service/issues/1#issuecomment-417431387 ?

Regarding point 7, it seems fine.
Regarding JSON input and output (the former is necessary as well, isn't it?), I would prefer it but do not insist on it.


How to limit/lock max peers of one room?

1st client: android 4.2.2 (cm 10.1.3 su640) phone, chrome
2nd client: kindle fire hdx, chrome
3rd client: ubuntu 12.04 @AMD A8 5500, chromium
Now SimpleWebRTC doesn't limit max peers of room. But vp8 software encoding/decoding can't afford 3 videos. Even for snapdragon 800, 2 remote videos cause bad definition. And on AMD A8 5500, cpu>60%. So I modified simplewebrtc.bundle.js, I insert
if($('video',container).length>0){
return;
}
in 3rd lines of SimpleWebRTC.prototype.handlePeerStreamAdded, but it only hided the 3rd video, audio peer is still added. And the 3rd client can still see the 2nd video.

signalmaster has an options to specify max number of peers in a room. You can then listen to 'error' event, which is triggered when a peer tries to connect to a full room.


Add action support to PodApi angular service

We need to add a method to the service for triggering pod actions.

@rudigiesler @KaitCrawford Ready for review.

One minor question, mostly for my own understanding. Otherwise looks good to me.

:+1:


external-dns CoreDNS provider is not deleting records in sync mode.

When trying to delete a record we get this error message:
time="2018-08-10T18:42:51Z" level=info msg="Delete key /skydns/net/cernerkube/echo"
time="2018-08-10T18:42:51Z" level=error msg="102: Not a file (/skydns/net/cernerkube/echo) [14]"

I believe this is due to the fact that echo is a directory and not a file. When the record is created it is created in the following location:
time="2018-08-10T18:31:51Z" level=info msg="Add/set key /skydns/net/cernerkube/echo/495b3e85 to Host=<IP_ADDRESS>, Text=\"heritage=external-dns,external-dns/owner=d2a50e5bc4124bda2765bc8a69a7b108,external-dns/resource=ingress/default/echo\""

Notice that the delete doesn't seem to be including the file.

@twittyc would you please share some steps for how to setup the exernal dns with CoreDNS?
We also have an issue at here https://github.com/kubernetes-incubator/external-dns/issues/648 but seems no progress, can you please help provide a draft steps here for me to follow up? If your step works, I would like to be the volunteer for https://github.com/kubernetes-incubator/external-dns/issues/648 to add the document.
FYI @xunpan

@gyliu513 ，hello，I also encounter same issue
coredns+external-dns

I create a ingress(nginx-ingress) with load-balancer and exterlnal-ip, the address end with 249
And nginx-ingress publish address status 249 to an ingress test.lalala
After I change and recreate ingress config, new ingress load-balancer bind with new exterlnal-ip, end with 250
And nginx-ingress publish address status 250 to the ingress test.lalala
when I dig test.lalala，there are two address 249 and 250，external-dns log alert：error msg="102: Not a file
after test case, when I change same ingress's address, old record won't delete
except this error, everything works fine.

here is my coredns and external config and deploy yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
namespace: kube-system
labels:
k8s-app: external-dns
spec:
replicas: 1
selector:
matchLabels:
k8s-app: external-dns
template:
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
labels:
k8s-app: external-dns
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: In
values:
- ''
serviceAccountName: external-dns
tolerations:
- key: CriticalAddonsOnly
operator: Exists
# - effect: NoSchedule
#   key: node-role.kubernetes.io/master
containers:
- name: external-dns
image: registry.opensource.zalan.do/teapot/external-dns:v0.5.4
env:
- name: ETCD_URLS
value: "https://host-a:2379,https://host-b:2379,https://host-c:2379"
- name: ETCD_CA_FILE
value: "/etc/kubernetes/etcd-pki/ca.pem"
- name: ETCD_CERT_FILE
value: "/etc/kubernetes/etcd-pki/client.pem"
- name: ETCD_KEY_FILE
value: "/etc/kubernetes/etcd-pki/client-key.pem"
args:
- --provider=coredns
- --source=service
- --source=ingress
- --registry=txt
- --interval=14s
- --log-level=debug
- --policy=sync
# - --fqdn-template="{{.Namespace}}.k8s.local"
# - --domain-filter=k8s.local
# - --namespace=default
# - --txt-owner-id=default.k8s.local
# - --metrics-address=":7979"
volumeMounts:
- mountPath: /etc/kubernetes/etcd-pki
name: etcd-certs
readOnly: true
volumes:
- hostPath:
path: /var/lib/etcd/pki
type: DirectoryOrCreate
name: etcd-certs
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
data:
Corefile: |-
.:53 {
# log . {
#   class denial
# }
  # 处理k8s内部svc解析
  kubernetes test.cloud in-addr.arpa ip6.arpa {
    pods insecure
    fallthrough in-addr.arpa ip6.arpa
  }

  # 处理ingress映射的.i域名
  etcd lalala {
    stubzones
    path /skydns
    endpoint https://host-a:2379 https://host-b:2379 https://host-c:2379
    tls /etc/kubernetes/etcd-pki/client.pem /etc/kubernetes/etcd-pki/client-key.pem /etc/kubernetes/etcd-pki/ca.pem
  }

  cache 30
  errors
  loadbalance round_robin
  whoami
  health
  prometheus <IP_ADDRESS>:9153
  proxy . xxx.yyy.zzz:53
}

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
k8s-app: coredns
# kubernetes.io/name: "CoreDNS"
name: coredns
namespace: kube-system
spec:
replicas: 2
selector:
matchLabels:
k8s-app: coredns
template:
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
labels:
k8s-app: coredns
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: In
values:
- ''
tolerations:
- key: CriticalAddonsOnly
operator: Exists
# - effect: NoSchedule
#   key: node-role.kubernetes.io/master
serviceAccountName: coredns
containers:
- name: coredns
image: coredns/coredns:1.1.4
args:
- -conf
- /etc/coredns/Corefile
livenessProbe:
failureThreshold: 5
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
ports:
- containerPort: 53
name: dns
protocol: UDP
- containerPort: 53
name: dns-tcp
protocol: TCP
- containerPort: 9153
name: metrics
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
volumeMounts:
- mountPath: /etc/coredns
name: config-volume
- mountPath: /etc/kubernetes/etcd-pki
name: etcd-certs
readOnly: true
dnsPolicy: Default
volumes:
- configMap:
defaultMode: 420
items:
- key: Corefile
path: Corefile
- key: rules.db
path: rules.db
name: coredns
name: config-volume
- hostPath:
path: /var/lib/etcd/pki
type: DirectoryOrCreate
name: etcd-certs

I'm trying to fix it in https://github.com/kubernetes-incubator/external-dns/pull/807

@Lujeni Yes. I noticed it :-). I referred your ticket in #807

@twittyc @stoneagle
The fix is merged. Please try your case with latest code diff. If it works, please close the ticket.

I can confirm that #807 fixed it.


Invalidate the VFS if a task with actions doesn't declare any inputs or outputs

First let's try failing when VFS retention is enabled and then try deprecating the behaviour.

This could be the validation warning we add for 7.0.


Added details for the access token copy method in the wizard

README is clear, but the message in the wizard is not. This PR simply add details on what to do.

Thanks @arsenicks


🦙 Add Loading icon

User Story
As a… user of ollamte
I need/want/expect to… be able to tell that the system is performing an action and hasn't frozen
So that… I know the system is functional
Value / Purpose
Not clear to user at the moment that the system is performing an action
Definition of Done

[ ] Add a loading icon a.k.a. throbber when a message is sent and the API call has yet to be returned.

Completed as per this PR. Could probably be improved upon and may be altered/removed when streaming is enacted.


[question] How to add column during migration

I have already defined a Model & created the table using migration. (With some data)
I found no way (using GO migration) to add a column.
There is a NewAddColumn(), but I can't seem to set the new column name. if I try with the full model, I get bun: AddColumnQuery requires exactly one column
Maybe I'm being a idiot, can you give an example on how to do this?
I have searched the docs, I can't find anything that would help me.

Try this:
	_, err = db.NewAddColumn().
		Table("stories").
		ColumnExpr("new_column TEXT DEFAULT ''").
		Exec(ctx)

@l0nax  -- Thanks I will try this, I used raw query to workarund this issue
bun.NewRawQuery(db, "alter table status add column updated_time timestamp with time zone ").Scan(ctx, &status)


jquery as a dependency should be lowercase in bower.json

One more tweak to make for bower.json.
All projects specified as dependencies should be in lowercase. Currently the dependency for jquery is like this:

"dependencies": {
"jQuery": "~1.11.0"
}

This causes issues during bower updates. Please change it to this:

"dependencies": {
"jquery": "~1.11.0"
}

Fixed. Thanks.

Thanks, can you put up a tag with that change?

On Dec 18, 2015, at 2:22 PM, Nachiket Mehta<EMAIL_ADDRESS>wrote:
Closed #6 https://github.com/Mediafly/mflyCommands/issues/6.
—
Reply to this email directly or view it on GitHub https://github.com/Mediafly/mflyCommands/issues/6#event-496309940.

Just pushed tag v1.9.9.


[HOLD for payment 2022-01-11] Password hint stylings are different when setting password - Reported by: @Anthony-hull

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Navigate to app
create a new account
go to email and hit link to create password
Enter valid password as per requirements,
Delete some characters to make password invalid
Compare password requirements styling

Expected Result:
Styling should stay the same
Actual Result:
Text shifts up a bit and styling looks different
Workaround:
unknown
Platform:

Where is this issue occurring?

Web
iOS
Android
Desktop App
Mobile Web

Version Number: 1.1.22-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/43995119/146614317-a35261eb-c0f5-4963-a2a7-773f9bcfda3a.mp4
Expensify/Expensify Issue URL:
Issue reported by: @anthony-hull
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1639680475352300
View all open jobs on GitHub
Upwork job: https://www.upwork.com/jobs/~01a7cff5fb60b65b1e

Triggered auto assignment to @Beamanator (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

https://github.com/Expensify/App/blob/d012bea6850bab9010e15d66d5b81220d569022c/src/styles/styles.js#L771-L791
textLabelSupporting is missing the line height and margin which the formError has.
Making sure the hint has these values applied for both form states would fix this.
I propose adding these values to:
https://github.com/Expensify/App/blob/d012bea6850bab9010e15d66d5b81220d569022c/src/pages/settings/NewPasswordForm.js#L106-L112

Triggered auto assignment to @puneetlath (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

Definitely can be worked by contributors, marked External

Current assignee @puneetlath is eligible for the Exported assigner, not assigning anyone new.

Upwork job here: https://www.upwork.com/jobs/~01a7cff5fb60b65b1e

@anthony-hull Does your proposal match with other forms on the page? Could you please share any example to compare?

I already did a search for the uses of formError across the app, there are not other instances where text with textLabelSupporting turns into an error with formError.
formError is only used by text that appears on error.
Does this cover what you're asking?

@anthony-hull 's proposal looks good. I can't think of any other optimization. It's a small change.
cc: @puneetlath
:ribbon: :eyes: :ribbon:

Thanks for reviewing @parasharrajat , I agree your proposal looks great @anthony-hull 👍
(I'm assuming the role of CME since I'm assigned too, hope you don't mind @puneetlath)

📣 @anthony-hull You have been assigned to this job by @Beamanator!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖

I plan to have a PR submitted on the 27th

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.24-19 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

https://github.com/Expensify/App/pull/6905

If no regressions arise, payment will be issued on 2022-01-11. :confetti_ball:

Sorry Anthony, looks like I never hired you in Upwork. I sent you a hiring offer now and will pay it as soon as you accept. Thanks!

no worries! I have accepted. thanks :)

Great, paid!


EACCES error after creating a new function

Describe the bug
After creating a function and pushing. The function produces this EACCES error for the function file.
 Lambda execution failed with status 200 due to customer function error: EACCES: permission denied, open '/var/task/index.js'
by changing all of the source file permissions I can work around this issue. chmod -R 755 src
Amplify CLI Version
4.43.0
To Reproduce
create a new function and push
Expected behavior
The function should just work out of the box.

OS: MacOS
Node Version 14.15.2

Hi @theAndrewCline does this error happen when running amplify mock function or when executing in the cloud? It seems like a local file permissions issue as I am unable to reproduce on my machine. Can you try creating a new function and see if the issue persists there as well?

It happens when executing in the cloud. Not when running amplify mock function

@edwardfoyle I also change my global prefix for npm and yarn to be ~/.local so all my packages are installed in ~/.local/.bin
I was wondering if that might be the issue.

@theAndrewCline it's possible that's related but that should only affect globally installed packages, not local ones. Does this happen if you add a new function, select one of the template, push without editing the function and then test it in the lambda console?

@edwardfoyle yes it does.

@theAndrewCline does the user that you are using in your shell have limited file system permissions? The .zip file that is uploaded to lambda will have the same permissions as the files on the local machine

@edwardfoyle to my knowledge the shell permissions have not been modified so they should be the default. I will verify with my companies it team and let you know if they have been.

@edwardfoyle I confirmed I just have a default MacOS admin account.

@theAndrewCline When you create a new function, what are the permissions on the index.js file?

Here the permissions are -rw------- for index.js

@edwardfoyle I think we can close this as it seems to be more related to my computer settings and not a cli issue.
My umask settings for the system are not the default for some reason.
Thanks so much for your help!

Just for reference, the permissions on the index.js file when I create a function are -rw-r--r-- which matches the permissions documented by lambda. More information on the issue can be found here: https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/
I think if you set the default unmask to 644 on your machine it should work:
https://support.apple.com/en-us/HT201684


Body class not removed under certain circumstances

Summary:
If React Modal is mounted and almost immediately unmounted, the body's class is not removed when the modal disappears. If this class is used to prevent scrolling, the body will remain unscrollable forever.
Steps to reproduce:

Create a project using React Modal.
Add the following component somewhere on the page:

import React, { useEffect, useState } from 'react';
import Modal from 'react-modal';

export const Flash = () => {
   const [hide, setHide] = useState(0);

   useEffect(() => {
       if (!hide) {
           setHide(true);
       }
   }, [hide])

   return <>
       {!hide && <Modal isOpen={true}>
           <div>
               Modal text.
           </div>
       </Modal>}
       Other text
   </>
}

Load the page and inspect the body element. Note that it still has the class ReactModal__Body--open even though no modal is open.

Expected behavior:
The body element should not have the class ReactModal__Body--open.
Link to example of issue:
https://codesandbox.io/s/react-modal-unmount-bug-duvib?file=/src/App.js
Additional notes:
This is happens because the example component is unmounting the modal immediately in a useEffect. This causes it to unmount after componentDidMount is called, but before ModalPortal's setState takes effect. So when componentWillUnmount is called on ModalPortal, it does not yet have the open state, so it does not decrement the counter of the className.

Hi @Plygon
It's not recommended to use conditional rendering on modal !hide && <Modal ... />.

Hi @diasbruno,
I completely agree that it doesn't make much sense to conditionally render a modal. The example only does so for simplicity's sake.
A more complete example would have the modal nested in a hierarchy of components. If any of its parent components are quickly mounted and unmounted in a similar way, the same effect will happen.
Of course rendering something and then immediately unmounting it is something that everyone should try to avoid, but it should not permanently affect the page in the event that it accidentally happens somewhere.

If the component that contains the modal has a conditional rendering, it's the same problem, unfortunately. (and it's had to debug too).
It would be nice to have the component where it is used (cohesion), but because of this problem, we can't have that (because of the animation). 😞

Maybe, we can try something that at least guarantee that those classes are removed.

Maybe the actions in beforeOpen can be called after the isOpen state is set to true, instead of before. That way it won't add the class until the state is actually set. It at least does the trick at first glance.
I have no clue if that would break something else, but I wanted to offer something instead of just reporting this and dipping!

This class is added to remove the scroll and fix the position...not sure if it will help in this case.

Hello! this issue has been affecting the site for my company and was wondering if any progress has been made for a fix yet before we try to figure out a workaround.
We have our modal buried in components and are having difficulty trying to figure out the cause of the dismount/mounting. In our use case, we lock the scrolling for the page when the modal is up but under specific use cases, exiting the modal does not remove "overflow-hidden" from the body. We figured the problem is similar to if not what Plygon reported here.

@GravityStart This is related to conditional rendering and createPortal. It's not recommended using in this case.

Hi there)
I ran into the same issue that @Plygon  and @GravityStart wrote about. I use className ReactModal__Body--open
as a sign that the modal is open. in some cases where the modal is not closed by changing the isOpen property, this className remains.
To fix this I used the following approach:

I created a wrapper component

import ReactModal from 'react-modal';

ReactModal.setAppElement('my-app-element-id');

function Modal(props) {
  return <ReactModal {...props} />
}

In this component, I added useEffect to the cleanUp function of which I added the following code:

  document.body.classList.remove('ReactModal__Body--open');
  document.getElementById('my-app-element-id')?.removeAttribute('aria-hidden');

Finaly, my code looks like this:

import ReactModal from 'react-modal';

ReactModal.setAppElement('my-app-element-id');

function Modal(props) {
  useEffect(() => {
    return () => {
      // this runs before the component is removed from the UI
      document.body.classList.remove('ReactModal__Body--open');
      document.getElementById('my-app-element-id')?.removeAttribute('aria-hidden');
    }
  }, [])

  return <ReactModal {...props} />
}

export default Modal;

// somewhere in some app page:

import Modal from 'src/components/Modal'

function SomeComponent() {
//...
  <Modal {...someReactModalProps}>
  // ...

And everything seems to be working great. But I'm not sure if this solution is correct, so I'm asking for your opinion)

@diasbruno What do you think of my solution to the problem? Is there anything that I didn't consider or missed (regarding the specifics of the react-modal component)? THX

@vadymshymko it's ok as a workaround for the problem, but it should not be handled by the user.
We need to investigate this further. Although, I don't have time to work on this, I can assist if you guys want to give it a try. Just @ me an I'll answer.

Hi, is there a fix for this?

Here is some more info on this issue for those who stumble upon this thread: The issue seems related to the new mount-unmount-mount cycle React 18 uses for component mounting in StrictMode. I don't have a solution, but the library maintainers probably need to update the mounting and clean-up code to account for this.

I see! I thought the info about StrictMode in React 18 could be helpful since we didn't have any problems with React 17, though I now understand that it's more complex than that.
Thanks for the advice on portals and parallel components! 🙌

We're finding this can happen due to automated browser tests being super fast, even though we are properly using isOpen

This also happens when there are modals embedded inside modals, or there are multiple modals on the page, opened by different buttons for example. Sometimes react-modal fails to remove the class ReactModal__Body--open when all modals are closed. Same as #764.
The useEffect hack above won't work because the class should remain if at least one modal is open. We'd need a separate wrapper without the effect for any inner modals, then it would work I suppose.
Is the use of a Context a possible solution by always rendering a single modal persistently in the app (opening and closing it but never removing it from DOM) and just replacing its contents? The problem is, it might be strange if you try to create a modal within another modal. Maybe the inner modal would just replace the outer one completely, losing it entirely?
Maybe the maintainers can make use of an useEffect somewhere that tracks the total count of open modals and removes the class when the count is <= 0. Or IDK.

@ADTC Working with a single modal is pretty easy. Once you start stacking and/or nesting modals + react new lifecycle the problems gets really big.
It's impossible to know all the use cases people are doing.
Also, without a proper reproducible example it gets hard to debug.

The best solution I can come up with is to do your HTML body structure like this:
<body>
  <main className='container'>
    {children}
  </main>
</body>

And have global CSS:
body {
  height: 100vh !important;
  overflow: clip !important;

  > main.container {
    height: calc(100vh - Hpx) !important; // Hpx is any sticky header height. If none, just height: 100vh will do.
    overflow-x: clip !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }
}

By permanently clipping body and using an inner container to scroll content, the modal will not scroll the content in the background, and we don't have to rely on react-modal to add/remove overflow dynamically. It will all be elegantly handled by static CSS.

@diasbruno Sad to say, I could not reproduce in a simple example of nested modals. Hopefully others can use this setup as a base and try to reproduce it: https://codesandbox.io/p/sandbox/react-modal-unmount-bug-forked-gzndqq?file=/src/App.js
I will try again another time. There might be more to this than what a simple example could reproduce.
That being said, I'm very happy with the HTML/CSS-only solution in my last comment. Works excellently well.

Expounding upon the approach provided by @vadymshymko
I use a wrapper around react-modal as well:
const EditorModal: React.FC<PropsWithChildren> = ({children}) => {
  // some custom effects and state and such just for my app

  useEffect(() => {
    Modal.setAppElement("#app-root");

    return () => {
      document.body.classList.remove("ReactModal__Body--open");
      document.getElementById("#app-root")?.removeAttribute("aria-hidden");

      // this line seems to also be required in addition to the approach offered by @vadymshymko
      document.body.style.overflow = "unset";
    };
  }, []);
}

That's fine. Let me know if you find something, so we can further investigate this.


Update kubectl cheatsheet

Wrong command to get events, must be prefixed with get

@Shubham82 Apologies, rancher desktop was hijacking my kubectl exec.
Printed the long version initially from kubectl and misread v1.22.16 as homebrew was printing v1.26.1 as the installed version 🤦♂

Thanks for your help and patience!


Registrator.jl

@JuliaRegistrator register

Registration pull request created: JuliaRegistries/General/122119
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v0.1.0 -m "<description of version>" d837ff643f42c54b1ed1f14a7aafa224e7ecf49c
git push origin v0.1.0


Store change history for each published guide with update_type=major

https://trello.com/c/qzHbv9S9/181-show-change-notes-and-page-history-at-the-bottom-of-guidance-page
Dependent on:
https://github.com/alphagov/government-frontend/pull/129
https://github.com/alphagov/service-manual-publisher/pull/209
https://github.com/alphagov/govuk-content-schemas/pull/274

Looks good to me


[libzippp] Update to v6.0-1.9.2

Hello,
Here is the upgrade to the latest version of libzippp.
Thanks.

Feature encryption tested successfully in the following triplet:

x86-windows
x64-windows
x64-windows-static


Error on PHP 7.4 arrow functions

PHPMD version: 2.8.1
PHP Version: 7.4.1
Installation type: (composer)
Operating System / Distribution & Version: (Debian GNU/Linux 10)

Current Behavior
Running phpmd on file that contains PHP 7.4 arrow functions shows an error "Unexpected token: fn"
Expected Behavior
No error shown.
Steps to reproduce

Create a php script with code that includes arrow function
Run phpmd on it

Hi, it will be fixed in the next release of PDepend:
https://github.com/pdepend/pdepend/pull/426


Add a short description to each library function (#551)

Closes #551
Introduced changes

Added a short description to each library function

Breaking changes

Checklist

[x] Linked relevant issue
[x] Updated relevant documentation
[ ] Added relevant tests
[x] Performed self-review of the code
[ ] Added changes to CHANGELOG.md

@LStan could you also add descriptions to docs/src/appendix/cheatcodes.md?

That issue already assigned to someone else? Is it ok if I do it?

@LStan it is not assigned to anyone, feel free to add more descriptions


When opt set to 1, plugin path not included in &rtp

In my config, for some conflict reasons(may give raise to another issue), I set some ZSaberLv0's plugins  to 'opt': 1
Jetpack 'ZSaberLv0/ZFVimJob', {'opt': 1}
Jetpack 'ZSaberLv0/ZFVimIgnore', {'opt': 1}
Jetpack 'ZSaberLv0/ZFVimDirDiff', {'opt': 1}
" zfvimim
if (Require('wubi') || Require('pinyin')) && g:has_terminal > 0
    Jetpack 'ZSaberLv0/ZFVimIM', {'opt': 1}
    if Require('wubi')
        Jetpack 'ZSaberLv0/ZFVimIM_wubi_base'
        let g:input_method = 'zfvim_wubi'
    else
        let g:input_method = 'zfvim_pinyin'
    endif
    Jetpack 'ZSaberLv0/ZFVimIM_pinyin'
endif

Then I found these plugins path not included in &rtp,  and some other plugins like Leaderf which may not be able to be merged, I can still  find their paths in &rtp. BTW, I installed plugins in a self-defined path.

Thanks. opt: 1 means that the plugin is not loaded (i.e., will not be added to rtp) until packadd <package-name>. So, it is not a problem. merged: false might help solving your problem. If you completed the issue without any problem, please close this issue. Best wishes,

Yes, my problem solved, thx!


Use logger from controller-runtime package

The recommended logger for Operators is in the controller-runtime package, but we could never get it to work.  Turns out we needed to use logf.SetLogger(), but this wasn't clear from the examples.
This PR enables it and converts the log.Printf() messages to use it.  I'll do separate PRs to update the other controllers and add a bit more verbosity where needed.  This was kept minimal to hopefully avoid conflicts with the other PRs in progress.
Sample new messages:
simon@wkstn05:~/go/src/github.com/storageos/cluster-operator$ ko logs pod/storageos-cluster-operator-66c5c7c6f5-l986r
2019-06-24T11:00:46.931Z	INFO	setup	Initializing	{"goversion": "go1.12.5", "os": "linux", "arch": "amd64", "operator-sdk": "v0.8.0"}
2019-06-24T11:00:47.005Z	INFO	setup	Registering Components
2019-06-24T11:00:47.007Z	INFO	kubebuilder.controller	Starting EventSource	{"controller": "job-controller", "source": "kind source: /, Kind="}
2019-06-24T11:00:47.007Z	INFO	kubebuilder.controller	Starting EventSource	{"controller": "job-controller", "source": "kind source: /, Kind="}
2019-06-24T11:00:47.008Z	INFO	kubebuilder.controller	Starting EventSource	{"controller": "node-controller", "source": "kind source: /, Kind="}
2019-06-24T11:00:47.011Z	INFO	cluster	Adding cluster controller	{"k8s": "v1.16.0-alpha.0.615+6d9f4659d8712a-dirty"}
2019-06-24T11:00:47.012Z	INFO	kubebuilder.controller	Starting EventSource	{"controller": "storageoscluster-controller", "source": "kind source: /, Kind="}
2019-06-24T11:00:47.012Z	INFO	kubebuilder.controller	Starting EventSource	{"controller": "storageosupgrade-controller", "source": "kind source: /, Kind="}
2019-06-24T11:00:47.012Z	INFO	setup	Starting the Cmd
2019-06-24T11:00:47.113Z	INFO	kubebuilder.controller	Starting Controller	{"controller": "job-controller"}
2019-06-24T11:00:47.113Z	INFO	kubebuilder.controller	Starting Controller	{"controller": "storageoscluster-controller"}
2019-06-24T11:00:47.113Z	INFO	kubebuilder.controller	Starting Controller	{"controller": "storageosupgrade-controller"}
2019-06-24T11:00:47.113Z	INFO	kubebuilder.controller	Starting Controller	{"controller": "node-controller"}
2019-06-24T11:00:47.213Z	INFO	kubebuilder.controller	Starting workers	{"controller": "job-controller", "worker count": 1}
2019-06-24T11:00:47.213Z	INFO	kubebuilder.controller	Starting workers	{"controller": "storageosupgrade-controller", "worker count": 1}
2019-06-24T11:00:47.213Z	INFO	kubebuilder.controller	Starting workers	{"controller": "node-controller", "worker count": 1}
2019-06-24T11:00:47.213Z	INFO	kubebuilder.controller	Starting workers	{"controller": "storageoscluster-controller", "worker count": 1}
2019-06-24T11:00:47.214Z	DEBUG	kubebuilder.controller	Successfully Reconciled	{"controller": "node-controller", "request": "/wkstn05"}
2019-06-24T11:00:59.978Z	INFO	cluster	Reconciling Cluster	{"Request.Namespace": "default", "Request.Name": "example-storageoscluster"}
2019/06/24 11:01:00 failed to get health of node <IP_ADDRESS>: Get http://<IP_ADDRESS>:5705/v1/health: dial tcp <IP_ADDRESS>:5705: connect: connection refused
2019-06-24T11:01:00.446Z	DEBUG	kubebuilder.manager.events	Warning	{"object": {"kind":"StorageOSCluster","namespace":"default","name":"example-storageoscluster","uid":"e0c6f046-0789-4705-92b1-fa0ce5e1d7bb","apiVersion":"storageos.com/v1","resourceVersion":"143708"}, "reason": "ChangedStatus", "message": "0/1 StorageOS nodes are functional"}
2019-06-24T11:01:00.452Z	INFO	cluster	Reconciling Cluster	{"Request.Namespace": "default", "Request.Name": "example-storageoscluster"}
2019/06/24 11:01:00 failed to get health of node <IP_ADDRESS>: Get http://<IP_ADDRESS>:5705/v1/health: dial tcp <IP_ADDRESS>:5705: connect: connection refused
2019-06-24T11:01:00.824Z	INFO	cluster	Reconciling Cluster	{"Request.Namespace": "default", "Request.Name": "example-storageoscluster"}
2019/06/24 11:01:01 failed to get health of node <IP_ADDRESS>: Get http://<IP_ADDRESS>:5705/v1/health: dial tcp <IP_ADDRESS>:5705: connect: connection refused
2019-06-24T11:01:12.357Z	DEBUG	kubebuilder.controller	Successfully Reconciled	{"controller": "node-controller", "request": "/wkstn05"}
2019-06-24T11:01:12.386Z	DEBUG	kubebuilder.controller	Successfully Reconciled	{"controller": "node-controller", "request": "/wkstn05"}
2019-06-24T11:01:15.452Z	INFO	cluster	Reconciling Cluster	{"Request.Namespace": "default", "Request.Name": "example-storageoscluster"}
2019-06-24T11:01:15.725Z	DEBUG	kubebuilder.manager.events	Normal	{"object": {"kind":"StorageOSCluster","namespace":"default","name":"example-storageoscluster","uid":"e0c6f046-0789-4705-92b1-fa0ce5e1d7bb","apiVersion":"storageos.com/v1","resourceVersion":"143750"}, "reason": "ChangedStatus", "message": "1/1 StorageOS nodes are functional. Cluster healthy"}
2019-06-24T11:01:15.736Z	INFO	cluster	Reconciling Cluster	{"Request.Namespace": "default", "Request.Name": "example-storageoscluster"}
2019-06-24T11:01:30.736Z	INFO	cluster	Reconciling Cluster	{"Request.Namespace": "default", "Request.Name": "example-storageoscluster"}

I've converted the other controllers to use the logger and removed the debug.

@darkowlzz update looks good, thanks


AVERAGEIF not working

Hello,
I noticed that #19 addresses kinda the same issue.
Even if I use utilities.ArrayMerge there are issues with the condition.
For example, what if I wanted to write AVERAGEIF(A1:B2, "!= 'N/A'").
This will fail because if one of the cells contain text, the eval will throw an exception because of:
eval(N/A != 'N/A')
Uncaught ReferenceError: N is not defined(…)
Also things like !=, &&, || are not very Excel like, but I can work around that by providing documentation to my users.
In the end what I want to do is use AVERAGE a bunch of cells but skip the ones with text and/or empty fields.
Thanks.

Thanks,
It seems I need to investigate all the *IF and *IFS formula, since it is similar issue with SUMIF, COUNTIF, and now AVERAGEIF
will try to fix and release update patch.
regards,
Ikhsan

Hi guys,
I had the same problem with the AVERAGEIF function, in version 2.2.8 of the library. What I did was modify the function of this:
AVERAGEIF:function(a,b,c){
c="undefined"===typeof c ? a:c;
for(var d=0, f=0, k=0; k<a.length; k++)
eval(a[k]+b) && (f+=c[k], d++);
return f/d
}
to this:
AVERAGEIF:function(a,b,c){
a=n.objectToArray(a);
c="undefined"===typeof c ? a:n.objectToArray(c);
for(var d=0, f=0, k=0; k<a.length; k++)
eval(a[k]+b) && (f+=c[k], d++);
return f/d
}
The only thing I did was to convert the parameters a and c to array objects, just as it is in the SUMIF function, I hope it helps you to find the problem with the other functions that you mention.
Regards!!


Get-AzureStorageContainer - Fails on VSTS but works locally

Hi,
I am attempting to use Get-AzureStorageContainer but it keeps failing on VSTS when using a Powershell Task. This works locally, but I keep getting a 403 on VSTS.

Have you tried the azure powershell task plus a service endpoint so credentials flow?

Hi Bryan,
Thanks for your reply :)
I can only do this using SasToken. So I will have to stick with the normal power shell task. Is this a known issue?

Can you share a sample script that is failing? We would like to know how you are using SASToken with Get-AzureStorageAccount.

Hi, I have stopped using this command and started querying the API directly but for reference purposes:
$ctx = New-AzureStorageContext -StorageAccountName "coditstgweinvictusstore" -SasToken ""
$containers = Get-AzureStorageContainer -Context $ctx

@grik001 I tried to reproduce your scenario but it worked for me, both locally and using VSTS. You can try to debug this further if you like by seeing exactly which command is failing. Enabling debug logs by adding a variable system.debug with value as true in your release definition might help you with this.

Closing this. Please reopen if required.


Add Country Spec Endpoint

This PR adds the following endpoint from the Stripe API:
https://stripe.com/docs/api#retrieve_country_spec
The US country spec is returned as mock data.
Let me know what you think. :)

Hi. Thanks for help. I like it except stripe >= 1.40. I'll merge PR without commit  	8d528af

Thanks I think I replaced that line with what's on master when I merged it in here:
https://github.com/rebelidealist/stripe-ruby-mock/pull/368/commits/0104becefb5fd0eca00ef2f07e4e992ea5e59578#diff-ebf1b65abf5e55397a399fae9331f0e8R20


RSDK-6632 - Typescript SDK throws if MotionConfiguration.obstacleDetectorsList is not specified

Steps to reproduce :
Typescript SDK encodeMotionConfiguration throws an exception if MotionConfiguration.obstacleDetectorsList is not specified
Expected behavior :
Typescript SDK allows all MotionConfiguration attributes to be optional

relates to https://github.com/viamrobotics/rdk/pull/3574

@nfranczak Tests are not passing

Pre-merge might be difficult with our current setup, I think post-merge is fine for now. All you'll have to do is:

bump the SDK version in this repo's package.json. That'll trigger our CI pipeline to ship a new version to NPM
install the new version in the RDK, use this method, and run npm run check. Nick S might be able to assist since he already started work here.


terra.tx.hash() throws AttributeError for any decoded transaction

terra_sdk version: 2.0.5 (built from source)
Python version: 3.9
Operating System: Ubuntu 20

Description
terra.tx.hash() throws AttributeError for any transaction.
Workaround is possible by calling directly terra_sdk.util.hash.hash_amino(b64_tx_data)
What I Did
from terra_sdk.client.lcd import LCDClient
from terra_sdk.util.hash import hash_amino
import base64
import time

terra = LCDClient(chain_id="columbus-5", url="https://lcd.terra.dev")

bi = terra.tendermint.block_info(7223134)
tx = terra.tx.decode(bi["block"]["data"]["txs"][0])
terra.tx.hash(tx)

throws AttributeError: 'MsgExecuteContract' object has no attribute 'pack_any'

I found another bug related to deserialization. Maybe it's also related to this one.
from terra_sdk.client.lcd import LCDClient
from terra_sdk.util.hash import hash_amino

terra = LCDClient(chain_id="columbus-5", url="https://lcd.terra.dev")

bi = terra.tendermint.block_info(7233659)
# this works
terra.tx.decode(bi["block"]["data"]["txs"][18])

# but this does not and crashes in TxBody.messages deserialization
terra.tx.tx_info(hash_amino(bi["block"]["data"]["txs"][18]))

error
File .../terra_sdk/core/authz/msgs.py:116, in MsgGrantAuthorization.from_data(cls, data)
    114 @classmethod
    115 def from_data(cls, data: dict) -> MsgGrantAuthorization:
--> 116     data = data["value"]
    117     return cls(
    118         granter=data["granter"],

KeyError: 'value'

It's the same issue as #100. @Vritra4 should be working on decoding Msg.

I found another bug related to deserialization. Maybe it's also related to this one.
from terra_sdk.client.lcd import LCDClient
from terra_sdk.util.hash import hash_amino

terra = LCDClient(chain_id="columbus-5", url="https://lcd.terra.dev")

bi = terra.tendermint.block_info(7233659)
# this works
terra.tx.decode(bi["block"]["data"]["txs"][18])

# but this does not and crashes in TxBody.messages deserialization
terra.tx.tx_info(hash_amino(bi["block"]["data"]["txs"][18]))

error
File .../terra_sdk/core/authz/msgs.py:116, in MsgGrantAuthorization.from_data(cls, data)
    114 @classmethod
    115 def from_data(cls, data: dict) -> MsgGrantAuthorization:
--> 116     data = data["value"]
    117     return cls(
    118         granter=data["granter"],

KeyError: 'value'

Hi @DusanFedorcak this is a mainnet related issue which is promting the bug causing the error. I will suggest you contact Terra support and talk with a Developer from Terra through their live chat Developers forum. Click on the  Forum ——>> TERRA DEVELOPERS LIVE CHAT  To help you sort this out right away


Connection reset by peer IOException did not fire

Background
I have a service that use Netty as client to collect information from thousands of host continuously. I expect Netty to throw IOException regarding connection reset by peer whenever the connection has been dropped by destination prior to write. While this expected behavior is happening on local test cases, it is not the case in our large scale environment. In my situation after connection being dropped, seems like Netty attempt to write and returned successfully but the channel got close immediately which result in my application to hang there assuming that the request still is in progress. The only way that I could identify the gap was to do tcpdump and sample those request. I simplify one of those request here:

Relative Time
Source
Destination
Protocol
Info

0.011689
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[SYC] Seq=0 Len=0

0.012461
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[SYC, ACK] Seq=0 Ack=1 Len=0

0.12480
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[ACK] Seq=1 Ack=1 Len=0

1.659652
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[FIN, ACK] Seq=1 Ack=1 Len=0

1.661622
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[ACK] Seq=1 Ack=2 Len=0

12.484883
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[PSH, ACK] Seq=1 Ack=2 Len=14

12.484921
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[FIN, ACK] Seq=15 Ack=2 Len=0

12.485665
<IP_ADDRESS>
<IP_ADDRESS>
TCP
[RST] Seq=2 Len=0

After this observation, I was able to set a listener to validate my assumption regarding channels getting closed prior to the exception being thrown out.
channel.closeFuture().addListener(new ChannelFutureListener() {
    @Override
    public void operationComplete(ChannelFuture future) throws Exception {
        //do logic to avoid the application to hang for this request.
    }
});

At this point I was able to validate that channel being closed after write while Netty returned write as successful. So I used this logic in order to develop a small test application to reproduce the issue described above.
Sample Test Case
I implemented a test scenario that reproduce the situation that happened above, but unfortunately I cannot share our actual code due to confidentiality. I am very new to Netty (~2weeks) so apologize in advance if I am completely doing it wrong here.
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.function.Consumer;

public class Test {

    public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
        Server server = new Server();
        new Thread(server).start();

        Client client = new Client();

        CompletableFuture future = client.process();

        server.countDownLatch.await();
        client.countDownLatch.countDown();

        future.get();
        System.out.println("Done!");
    }

    public static class Client {
        public CountDownLatch countDownLatch = new CountDownLatch(1);

        public CompletableFuture process() {
            NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup();
            CompletableFuture future = new CompletableFuture<>();
            try {

                ChannelFuture connection = new Bootstrap()
                        .group(eventLoopGroup)
                        .channel(NioSocketChannel.class)
                        .handler(new ChannelInitializer<Channel>() {
                            @Override
                            protected void initChannel(Channel channel) throws Exception {
                                channel.pipeline().addLast(new StringDecoder());
                                channel.pipeline().addLast(new StringEncoder());

                                channel.pipeline().addLast(
                                        new SimpleChannelInboundHandler() {

                                            @Override
                                            protected void channelRead0(ChannelHandlerContext ctx, Object o) throws Exception {
                                                /* process response */
                                                future.complete("Done");
                                                ctx.channel().close();
                                            }

                                            @Override
                                            public void exceptionCaught(ChannelHandlerContext ctx, Throwable ex) {
                                                future.completeExceptionally(ex);
                                                ctx.channel().close();
                                            }
                                        }
                                );
                            }
                        }).connect(new InetSocketAddress("localhost", 5555));

                connection.addListener((ChannelFuture channelFuture) -> {
                    if (channelFuture.isSuccess()) {
                        String message = "Message";
                        try {
                            countDownLatch.await(); /* wait to ensure connection drop by client first */
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                        channelFuture.channel()
                                .writeAndFlush(message)
                                .addListener((ChannelFuture writeFuture) -> {
                                    if (!writeFuture.isSuccess() || writeFuture.cause() != null) {
                                        future.completeExceptionally(new Exception("Failed to write"));
                                    }
                                })
                                 //Close the connection as Netty closed after write.
                                .addListener(ChannelFutureListener.CLOSE);
                    } else {
                        future.completeExceptionally(new Exception("Failed to connect"));
                    }
                });
            } catch (Exception e) {
                future.completeExceptionally(e);
            }

            return future;

        }

    }

    public static class Server implements Runnable {

        private ServerSocket serverSocket;
        public CountDownLatch countDownLatch = new CountDownLatch(1);

        public Server() throws IOException {
            this.serverSocket = new ServerSocket(5555);
        }

        @Override
        public void run() {
            try {
                Socket socket = serverSocket.accept();
                Thread.sleep(500);
                socket.close();
                countDownLatch.countDown();
            } catch (IOException | InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

Netty version
Netty 4.1.48.Final
JVM version (e.g. java -version)
openjdk version "11.0.11" 2021-04-20 LTS
OpenJDK Runtime Environment (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM (build 11.0.11+9-LTS, mixed mode)

Please upgrade to the latest version of Netty and test again.

In my situation after connection being dropped, seems like Netty attempt to write and returned successfully but the channel got close immediately which result in my application to hang there assuming that the request still is in progress.

When you say you application is hung, what is it waiting for? Is it waiting for a read? I would expect reads to fail when the socket is closed. Since there is an inherent race between you writing and socket getting closed in parallel (closing the server socket as you do in the example does not ensure that the client sees the full closure), I would not solely rely on write results to indicate socket liveness.

Please upgrade to the latest version of Netty and test again.

@hyperxpro Good callout, I would definitely test this with most recent version and update this thread, but as of now, the process would be very hard on rolling out my service with new version and can take a month or so.

When you say you application is hung, what is it waiting for? Is it waiting for a read? I would expect reads to fail when the socket is closed. Since there is an inherent race between you writing and socket getting closed in parallel (closing the server socket as you do in the example does not ensure that the client sees the full closure), I would not solely rely on write results to indicate socket liveness.

@NiteshKant For each request as part of this data collection, I have a Future as I am trying to process everything async so due to the behavior described above, some of these Futures are not completed which result in my application to hung for them to complete. You are right about the fact that read should fail but in this case channel is closed after write. In my production code, I also utilize the IdleStateHandler, but the fact that Netty closing the channel, wouldn't let those timeout process to also handle this edge case. Your point about not solely rely on write result is fair, but still doesn't change the fact that Write is completed successfully while the server didn't ACK it. As I mentioned, one option is to rely on channel closure listener, or another one would be to write my own timeout outside of the channel pipeline for these request. Otherwise, I wouldn't be able to rely on Netty to complete my Future.

but still doesn't change the fact that Write is completed successfully while the server didn't ACK it.

This is as expected, netty will only return the local write result to the FD and not wait for TCP packet ack if that is what you are looking for.

@NiteshKant Thank you for clearing that out. Then isn't it reasonable to expect java.io.IOException: Connection reset by peer being thrown after write, for the read ? cause in that way I can rely on my channel pipeline to caught that exception and complete the Future.
Here is the stack that local runs can produce in similar situations.
Caused by: java.io.IOException: Connection reset by peer
	at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
	at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
	at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
	at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)

Then isn't it reasonable to expect java.io.IOException: Connection reset by peer being thrown after write, for the read ?

If the connection is fully closed then eventually read will throw the exception that you mention. Timing of write does not matter for exception in read, just to be clear.

cause in that way I can rely on my channel pipeline to catch that exception and complete the Future.

If you just want to listen for channel closure then you can implement channelInactive() method in your handler or from the channel you can listen to the closeFuture()

Great advise @NiteshKant, I would definitely give this a try and update this thread if I learn anything new. Thank you for chiming in.
Maybe we can have separate discussion on making change to the write to not only look at local result as part of the FD and also wait for the server ACK. For me as a user, when I use TCP, I expect the library to follow the protocol completely. I'm sure there would be tradeoffs here, still trying to learn more about Netty.

Maybe we can have separate discussion on making change to the write to not only look at local result as part of the FD and also wait for the server ACK.

Separate discussion sounds good although I do not think that is something we want to do in netty as a netty channel is one end of the connection just like a JDK socket is.

@pedramsouri I will close this issue, please reopen if there is something more to be discussed.


Sitemap implementation

Great!! I did the last little things, so don't worry about this anymore. Thank you


Fixes #5804

This PR fixes #5804.
It's not a my own solution, but the one provided by @ngrevet-lightspeed.
Since I need this fixed, I made this PR on behalf of @ngrevet-lightspeed.

@Ocramius @ngrevet-lightspeed Everything should be fine, now. I was too hurried, last time. Sorry.

@alle I still don't see test changes though :-\

@Ocramius Well, I thought tests shouldn't change, should they?
I thought I fixed this bug, working on the BasicEntityPersister::fetchVersionValue() method, by passing the involved tests, without changing them. Humbly, am I missing something?

@alle a test demonstrating the original bug (failing with the original repository state, passing with this patch) is needed ;-)

@ocramius: @astepin did the job (in #6496) that I should have done from myself.
@astepin The only change I made is in the custom type getSQLDeclaration() method: your version was failing against the Postgres platform, since Doctrine maps to a specific datatype for that platform.

I changed the involved classes in tests, complying to other tests' structure, in order to avoid a merge conflict on the SchemaValidatorTest, due to recent updates

@Ocramius @lcobucci Is there any possibility to have this PR merged? I didn't see any news since the last changes.

I'll take a look at this in a bit

@alle thanks for your contribution, I've simplified things a bit (kept all test related classes together).
@Ocramius it LGTM, can you check this one to see if we're good to go?

@alle 🚢 thanks!

Thank you so much, guys!
This was my first opportunity to contribute to this project, even to "calibrate" myself to future contributions. Or at least I hope so!


Removed silverlight build infrastructure

I assumed files with a *-SL* pattern to be associated with Silverlight.
Will hold off on going deeper as you mentioned later on in #165
Cleaner or no?

@fir3pho3nixx looks great! Rename this PR if you are happy for it to be merged.

@jonorossi - Good to go!

Just realised you missed removing the Silverlight lines in buildscripts/*.nuspec, need those removed otherwise we'll have a broken build.

@jonorossi - All done.

Great, thanks Gav.


bug: CMP works but hover does not.

Did you check docs and existing issues?

[X] I have read all the lazydev.nvim docs
[X] I have updated the plugin to the latest version before submitting this issue
[X] I have searched the existing issues of lazydev.nvim
[X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)
0.10
Operating system/version
MacOS
Describe the bug
I've already solved the issue but might see other getting stumped by the same issue.
I had autocompletion working with CMP but when hovering over symbols it was not working.
I resolved this by running checkhealth and seeing that lazy wanted luarocks installed.
After installing luarocks with brew the issue is now resolved
Steps To Reproduce
Solved.
Expected Behavior
This can now be moved to close as i just want to help others who might encounter the same issue.
Repro
No response

For anyone looking in the comments.
My issue was that i was missing the installation of luarocks and so hover was showing vim: unknown


[d3d9] Add D3D8Bridge for d3d8

Part of #3411
D3D9Bridge is how d3d8 is can affect the behavior of d3d9 and use the dxvk backend in cases where that's needed. This PR does not implement every feature that it can use, it just adds the interface.

Make sure you squash :)


Allow image-upload to recover from PendingPopulation phase

What this PR does / why we need it:
This PR aims to fix virtctl image-upload so we allow DVs to recover from PendingPopulation phase, as we do with WaitForFirstConsumer.
This means that, if an image-upload command fails due to a DV being in PendingPopulation phase, we can call the command again after creating a consumer and the upload will continue as expected.
Which issue(s) this PR fixes:
Fixes # https://bugzilla.redhat.com/show_bug.cgi?id=2236060
Special notes for your reviewer:
Release note:

Bugfix: Allow image-upload to recover from PendingPopulation phase

/test pull-kubevirt-e2e-k8s-1.27-sig-compute

Very nice!
/lgtm
/approve

/cherry-pick release-1.0


Wrong codegen with while and &&

Given:
x = nil
y = nil

while !(x && y)
  pp x
  x = 1
end

The above code will print x # => nil forever, which is wrong because x is clearly assigned the value 1 inside the loop.
The same happens with until:
x = nil
y = nil

until x && y
  pp x
  x = 1
end

(but until exp is currently re-written to while !exp so the above is logical to happen)
Extracted from #4239

Copying over from the other issue:
Using while !(a && b): https://carc.in/#/r/1t8j (unexpected behavior)
Using while !a || !b: https://carc.in/#/r/1t8n (expected behavior)
Using while !(Glob.a && b) (Glob is a class): https://carc.in/#/r/1t8p (expected behavior)
Using while !Glob.a || !b (same result): https://carc.in/#/r/1t8q (expected behavior)
Using while !(a && b), assigning a to Glob.a: https://carc.in/#/r/1t8r (unexpected behavior with a, expected behavior with Glob.a)
Using while !(a && b), assigning a to Glob.a: https://carc.in/#/r/1t8s (expected behavior with both a and Glob.a)
To sum it up, it seems like setting the value of a in the scope of a while !(a && b) actually creates a new local variable instead of modifying the one in the outer scope, while while !a || !b has the expected result of modifying the local variable in the outer scope.
EDIT:
First test, but printing the value of a after the loop: https://carc.in/#/r/1t8u
Actually, it does change the variable of the outer scope, but the value of a at the beginning of the scope of each loop is set back to the initial value before the loop?
EDIT 2:
Expanding the while condition of the first test from !(a && b) to !((a != nil) && b) produces expected behavior: https://carc.in/#/r/1t90
But, expanding the condition from !(a && b) to !(!a.nil? && b) retains the unexpected effect: https://carc.in/#/r/1t92


Dynamic Duo at it again!

Matt is terrific and taught me to math! Hooray! We created functions with clear names and cool stuff. Check it out. You will like it a lot.

LGTM!


[TableDirector/CollectionDirector] elementAt gives back the wrong element

I've discovered a but in the function elementAt (L:267) in the TableDirector.
The function returns the same element because the return value uses the wrong index to search the elements array. Here is the current line which returns the element:
return sections[indexPath.section].elements[indexPath.section]
I think the index in the elements array should be indexPath.row.

I realised I could also fork your repo and try to fix it myself; as such, I made a MR

Fixes merged! thanks.


change files

@yoyazhang Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.


Some branches fail after build (e.g. https://tr-b-ashmind-features-coalesce-assignment.azurewebsites.net/status)

Is this the reason why the dropdown currently does not contain the master branch?

@svick Thanks for reporting -- that seems to be a separate issue where master failed to build (my bug), and built excluded it. I created a ticket to make sure such branches don't just disappear (gh-69).
I've also just forced a rebuild, should appear soon.

@svick master branch is available now.

@ashmind Thanks.

Since old branches will fail the new build anyway, I'll close this until I see it again.


Build failing due to clair-scanner connection problem

The current builds are failing due to a clair scanner problem.
$ clair-scanner -w tests/cve-scan-whitelist.yaml -c "http://<IP_ADDRESS>:6060" --threshold="High" --ip "$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" $IMAGE_NAME:latest
Device "eth0" does not exist.
2019/10/08 20:14:11 [INFO] ▶ Start clair-scanner
2019/10/08 20:14:16 [INFO] ▶ Server listening on port 9279
2019/10/08 20:14:16 [INFO] ▶ Analyzing 0695c281e5f4d28f2363f55bebfdc752a9e4679eed17a055005113f0635ff613
2019/10/08 20:14:16 [CRIT] ▶ Could not analyze layer: Clair responded with a failure: Got response 400 with message {"Error":{"Message":"could not find layer"}}
The command "clair-scanner -w tests/cve-scan-whitelist.yaml -c "http://<IP_ADDRESS>:6060" --threshold="High" --ip "$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" $IMAGE_NAME:latest" exited with 1.

Done. Your build exited with 1.

The cause seems to be Device "eth0" does not exist.  Since there were no changes in this repo, this may be caused by a change in the travis vm.

Fix merged


Prediction market ontology

This idea seems very useful to me, although it'll probably not make it into v1.0 of augur: https://github.com/joeykrug/essays/blob/master/ontopreds.md
...
@tinybike what action needs to be taken?
-Chwy5
...
Closing since the link is broken and the purpose of this ticket is unclear.
-adrake33
...
Reopening this ticket since @tomhaile sent me an updated link.
-adrake33
...
Main time this becomes useful is if we do the first dispute api stuff I’ve been talking about in discord --- can discuss further whenever you guys want
-joeykrug
...
Assigning this to Alex/Austin for further consideration.
-adrake33
...
What work for this would actually be something we would do? I'm not sure exactly how contracts would come into play here specifically since this is labeled as a backend issue.
-nuevoalex
...
Yeah, this ticket doesn't really seem like it should have been set as Backend. It sounds more like an Augur Node/frontend issue.  If you think this is something you'd prefer to postpone, I'll just move it to the backlog.
-adrake33
...
Actually, I suppose it could potentially affect the contracts if we wanted certain elements of the market description to be stored in a certain way on the blockchain, and then those elements could be passed by Augur Node to the frontend so that multiple languages could be supported. I'm not entirely sure what Jack had in mind here, though.
-adrake33
...
The extraInfo field of the market could already support storing this information.
-nuevoalex
...
Yeah, true. In that case, this wouldn't require contract changes. I'll change this to a Frontend issue.
-adrake33

@joeykrug @pgebheim can this be closed?


add Tureng extension

Thanks, but please submit extensions in the source directory not as compiled extensions. Closing.

I'm sorry for the very long delay getting to this pull request, and for this copy-and-pasted message:
Thansk for your contribution! To get through my backlog, I'm now merging all reasonable pull requests.
Once done, I'm going to move all user-contributed extensions into a new contrib directory in the repo, so you will eventually find it there. After that, in due course, I will move some contributions back over to the main directory to be published.
Please bear with while I am working though a lot of pull requests at the moment.


Update psycopg2 connection methods

Finally getting connection from Lambda Functions to Performance Manager RDS.

Update lambda deploy action to install ssl cert using curl and putting it in the zip file. Access it correctly in postgres_utils dot py if there is no password in the environment.
Update psycopg build, taking it from a gitlab repo for now (still need to figure out how to build it ourselves)
Properly connect to the RDS in postgres_utils dot py.

Asana Task: https://app.asana.com/0/0/1202708844890309/f

LGTM


chore(main): release 1.2.1

:robot: I have created a release beep boop
1.2.1 (2024-07-17)
Bug Fixes

fixing release please action (2c278b5)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/Injsted/next-template/releases/tag/v1.2.1 :sunflower:


Equations extend beyond column width in smaller browser windows

Where is the problem?
https://learn.qiskit.org/course/ch-algorithms/quantum-fourier-transform
What is the problem?
Equations extend beyond column width in smaller browser windows. Example:

What would you expect?
Content fits the screen size

This repository is no longer maintained. It has been superseded by IBM Quantum Learning.