fix rename room permission

Details

Fix rename room permission
Fixed Issues

$ https://github.com/Expensify/App/issues/21498
PROPOSAL: https://github.com/Expensify/App/issues/21498#issuecomment-1605588348
Tests

Let User A Create a new room where User B is a member.
Using User B click on the room avatar on top.
Verify that user B can't change the room name
From userA copy url to the rename page and paste to the userB browser.
Verify that user B can't change the room name

[x] Verify that no errors appear in the JS console

Offline tests
Bug is not related to offline mode itself. No extra steps needed.
QA Steps

Let User A Create a new room where User B is a member.
Using User B click on the room avatar on top.
Verify that user B can't change the room name
From userA copy url to the rename page and paste to the userB browser.
Verify that user B can't change the room name

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else
[x] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots

Web
https://github.com/Expensify/App/assets/16502320/b9542fa2-2c13-42ab-a468-2f0bf18be630

Mobile Web - Chrome
https://github.com/Expensify/App/assets/16502320/a4934739-7ec3-4b55-bdd7-7e4e593b9bd4

 Mobile Web - Safari
https://github.com/Expensify/App/assets/16502320/20e6b778-b6b9-4a54-8a02-908d0a8865f9

Desktop
https://github.com/Expensify/App/assets/16502320/e6c0f7f7-84ca-4b90-ba94-79a6c10d7283

IOS
https://github.com/Expensify/App/assets/16502320/3ebe01e2-899a-4c13-8859-58e4b74a4669

Android
https://github.com/Expensify/App/assets/16502320/003954e0-9c73-46ba-9b86-69349d0dcd2a

@hungvu193 Room rename option should be disabled even in offline mode on the room details page. Kindly update the offline tests accordingly

@hungvu193 Kindly test the mentioned test flows and add the videos to the author's checklist. In some platforms only the error page on url flow is mentioned, on some only the room rename from details is present.

Reviewer Checklist

[x] I have verified the author checklist is complete (all boxes are checked off).
[x] I verified the correct issue is linked in the ### Fixed Issues section above
[x] I verified testing steps are clear and they cover the changes made in this PR

[x] I verified the steps for local testing are in the Tests section
[x] I verified the steps for Staging and/or Production testing are in the QA steps section
[x] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[x] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[x] I verified tests pass on all platforms & I tested again on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[x] I verified proper code patterns were followed (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I verified that this PR follows the guidelines as stated in the Review Guidelines
[x] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else
[x] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web

https://github.com/Expensify/App/assets/46707890/466c8bf1-f526-40f9-a2e5-aab67dd91016

Mobile Web - Chrome

https://github.com/Expensify/App/assets/46707890/a95549f9-1279-4cfa-96b9-45f39cedc52b

Mobile Web - Safari

https://github.com/Expensify/App/assets/46707890/6c887e58-2074-4c5b-ac72-702b6a81566d

Desktop

https://github.com/Expensify/App/assets/46707890/9a52a06f-6c34-43a1-919b-076ff11b381f

iOS

https://github.com/Expensify/App/assets/46707890/d1d2f98a-82ad-435a-ab25-77205cc6bc08

Android

Reviewer Checklist

[x] I have verified the author checklist is complete (all boxes are checked off).
[x] I verified the correct issue is linked in the ### Fixed Issues section above
[x] I verified testing steps are clear and they cover the changes made in this PR

[x] I verified the steps for local testing are in the Tests section
[x] I verified the steps for Staging and/or Production testing are in the QA steps section
[x] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[x] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[x] I verified tests pass on all platforms & I tested again on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[x] I verified proper code patterns were followed (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I verified that this PR follows the guidelines as stated in the Review Guidelines
[x] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else
[x] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web

https://github.com/Expensify/App/assets/46707890/ed06e4aa-e149-44f1-9a54-706b4ee10885

Mobile Web - Chrome

https://github.com/Expensify/App/assets/46707890/18a87fb0-9417-4a04-8bf5-2db7aa86d581

Mobile Web - Safari

https://github.com/Expensify/App/assets/46707890/7ee307b1-ba6c-4b5c-920c-67fc2dfdf26c

Desktop

https://github.com/Expensify/App/assets/46707890/f2a0a576-7dfd-4d3c-99c8-e43ea344e1ff

iOS

https://github.com/Expensify/App/assets/46707890/45a3658f-e304-48e8-b3fb-8c4440edad80

Android

https://github.com/Expensify/App/assets/46707890/17b2594d-cf87-44f4-97e2-0615629494d1

NAB: @hungvu193 Kindly update the author's checklist Offline test to reflect "Same as tests", since this change is expected to work in offline as well.

@hungvu193 It seems there is new merge conflicts on this PR

@hungvu193 After recent merge I am unable to rename a room, only showing page not found view? Can we check and fix this?
https://github.com/Expensify/App/assets/46707890/36f409df-333f-426f-b5c0-0e79777852d6

Reviewer Checklist

[x] I have verified the author checklist is complete (all boxes are checked off).
[x] I verified the correct issue is linked in the ### Fixed Issues section above
[x] I verified testing steps are clear and they cover the changes made in this PR

[x] I verified the steps for local testing are in the Tests section
[x] I verified the steps for Staging and/or Production testing are in the QA steps section
[x] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[x] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[x] I verified tests pass on all platforms & I tested again on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[x] I verified proper code patterns were followed (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I verified that this PR follows the guidelines as stated in the Review Guidelines
[x] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else
[x] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web

https://github.com/Expensify/App/assets/46707890/f6071aa8-ecdd-47b1-b34d-877936e1835c

Mobile Web - Chrome

https://github.com/Expensify/App/assets/46707890/6f328d7c-d457-4b64-8d1a-27402eaa4d81

Mobile Web - Safari

https://github.com/Expensify/App/assets/46707890/1e9a0680-2f4c-4d39-ae5d-25db3ddbfd05

Desktop

https://github.com/Expensify/App/assets/46707890/77e06ef9-8296-419b-a82d-bc91af5630e2

iOS

https://github.com/Expensify/App/assets/46707890/1887f6b1-d1f2-454a-8535-b4ac5a3c7797

Android

NAB: @hungvu193 Kindly update the author's checklist Offline test to reflect "Same as tests", since this change is expected to work in offline as well.

NAB: @hungvu193 Kindly update this as well.

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.43-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅

🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.43-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅

🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.44-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.43-7 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅


#69 - Switch HTTP request to load Modals from GET to POST

Should resolve issue shown in issue #69.

SNAPSHOT build for testing:
asset-share-commons.ui.apps-1.6.1-SNAPSHOT.zip

bro! @davidjgonzalez your supposed to be on vaca


Add limit logs support

[✔] Add limit logs support

[✔] Update README

[  ] (Help needed) --since value provided explicitly. eg --since=5m . Any need to make it user inputtable ?

Fix to : #765

@lstocchi Yes, you are right. hard coded values are not good.
Please share ideas on how to allow user to input value. 🚀
@itowlson

I did wonder if we could add a drop-down to the logs webview to specify the 'since' interval, but I don't think that works well unless we default to limiting - otherwise the webview displays everything first, and then you get to say "uh no only the last 30 seconds" which isn't a great user experience!
But a possible development of that would be to do something like this:

Get rid of separate Show, Follow and Limit Logs commands; just have a Logs command
When the webview starts up, it does not display logs immediately.  Instead it displays only the toolbar, with options like:

Show or Follow
Time period to show (e.g. 1/2/5/10/20/30 mins/1/2/6/24/48 hours/All)
Filter options (as present)

The toolbar also has a Go button
And we fetch the logs when the user presses the Go button

Thoughts?
One issue with this is for folks who prefer their logs in the terminal.  I guess we could have another option in the toolbar to send the logs to the terminal (which would disable the Filter options... unless anyone fancies constructing the right grep incantation and executing a piped command), but not sure that's the right experience.
If we don't want something that radical then yes, a VS Code quick pick is the way to go to select the time interval.  But I'm not sure we want to force users to go through that quick pick every time they want to view logs...

Thinking about this I am tempted by the Radical Webview option because it gives us somewhere to put future knobs too, rather than requiring more commands and more quick picks for more and more log options.
Also, the "which container do you want to see logs for" quick pick (for multi-container pods) could go in the toolbar too.

When the webview starts up, it does not display logs immediately. Instead it displays only the toolbar, with options like:

Show or Follow
Time period to show (e.g. 1/2/5/10/20/30 mins/1/2/6/24/48 hours/All)
Filter options (as present)

This sounds like the best way forward to me 👍

I guess we could have another option in the toolbar to send the logs to the terminal

I also really like this idea.
However it's implemented, having a way to limit log output will be a huge win for this extension.

Thinking about this I am tempted by the Radical Webview option because it gives us somewhere to put future knobs too, rather than requiring more commands and more quick picks for more and more log options.
Also, the "which container do you want to see logs for" quick pick (for multi-container pods) could go in the toolbar too.

I agree with this. It could be quite handy to have a unique webview to manage/add other features in future.

If we don't want something that radical then yes, a VS Code quick pick is the way to go to select the time interval. But I'm not sure we want to force users to go through that quick pick every time they want to view logs...

It's a radical solution but if we don't do it now I have the feeling we will end up with this discussion again in the future. So, better to tackle it now.
I also don't like much showing a quick pick before to show logs but this was the only idea i had. If we have a better solution, we should go for that.

But a possible development of that would be to do something like this:

Get rid of separate Show, Follow and Limit Logs commands; just have a Logs command

When the webview starts up, it does not display logs immediately.  Instead it displays only the toolbar, with options like:

Show or Follow
Time period to show (e.g. 1/2/5/10/20/30 mins/1/2/6/24/48 hours/All)
Filter options (as present)

The toolbar also has a Go button

And we fetch the logs when the user presses the Go button

Thoughts?

+1

@Devjeel Sorry, I had not thought about these complexities when I tagged it as a good first issue!  I hope you're still keen to work on it?!

@itowlson this sounds great ;) . Let me give it a try. If you can suggest how to implement webview/toolbar type for logs option ?

@Devjeel The toolbar is already in there with the filter functionality and a "scroll to bottom" button.  You should be able to add new controls to that existing toolbar.  The tricky bit will, I think, be deferring the fetch of the logs until the user hits the Go button.

@Devjeel Forgot to say, thanks for doing this!

Any news on this PR @Devjeel ? Do you want us to handle it?

Any news on this PR @Devjeel ? Do you want us to handle it?

Hi @lstocchi , got caught in my own stuff. Please assign it to someone else. Thanks.

Ok thank you @Devjeel !!


Feature request: Appx Packaging APIs

Motivation
The Win32 Metadata project already has bindings for this interface, so why not?
Drawbacks
No response
Rationale and alternatives
No response
Additional context
Microsoft is promoting appx everywhere but the only language its APIs exists for is C/C++.

I find this quite interesting. Look at the official repo's ILSpy demonstration pic. You can see Windows.Win32.AppxPackaging right there. But I checked the latest winmd file myself in ILSpy, it doesn't have AppxPackaging bindings. Why would they remove it?

These APIs are now under Windows.Win32.Storage.Packaging.
Docs: https://microsoft.github.io/windows-docs-rs/doc/windows/?search=Appx

Uhh, my bad, Weird choice to put it under Storage though


integration test coverage

Coverage increased (+41.7%) to 66.667% when pulling ea3a9635f58a0da98907124974f5130984ab4b60 on itcoverage into 8bad66be06912273059f668e65deab3373094f80 on master.


JSON response uses the ApplicationLayout

Given the following Rails controller:
class MyController < ApplicationController
  layout -> { ApplicationLayout }

  def index
    respond_to do |format|
      format.json
      format.html { render(MyPhlexView.new) }
    end
  end
end

When requesting the JSON content, the AppliactionLayout will be rendered

Hey @albertorestifo, I’m not able to reproduce this. Here's what I’m doing:
class ExamplesController < ApplicationController
  layout -> { ApplicationLayout }

  def index
    respond_to do |format|
      format.json { render json: { message: "Hello" } }
      format.html { render Examples::IndexView.new }
    end
  end
end

When I render /examples, I get the HTML in the template. When I render /examples.json I get just the { "message" : "Hello" } JSON.

@joeldrapper the difference in your example is that you're rendering a json payload directly.
In my rails app, I'm following the "default" pattern of having view files like: index.json.jbuilder, which then render a JSON partial.
That's why I'm not specifying any block to the format.json call, to let Rails fall down the default path.
In this case, the expected behaviour should be that the AppliactionLayout is ignored, as it's a JSON response, and rails follows the default search pattern for a view template.

Thank you. I'm hoping there's an interface for specifying the format of a template object in Rails. It's not documented but I expect it's there somewhere.

It doesn't look like there's an interface for a layout to specify which formats it supports. I think Rails manages this when the layout is a string because it looks for a layout file with the same extension as the template.
We need some layer above the layout class that is able to select a layout depending on the format. I'm not sure the best way to do this. 🤔

Right now, an easy workaround is to keep using a ERB template as the layout instead of using a Phlex layout

Another workaround and actually my preferred way of doing layouts is to specify layout false and then create a layout component that your views render as the first thing in the view template.
This is less "railsy" but in some ways it's a lot better because it means the top of your layout is rendered before the page so you could use the upcoming streaming features when they're ready.
I still want to find a fix for this issue though because supporting standard layouts is important for the intermediate phase where you may still have some ERB views.

@albertorestifo you should be able to configure your layout like this.
layout -> (controller) { controller.formats.include?(:html) ? ApplicationLayout : false }


Support for dragging and dropping files

It would be nice if it was possible to send files by dragging them to the chat. Right now it just seems to download a copy of the file.

I will fix this, I've got an idea and I think it will work.

This feature is already working right now.
Please see our new beta: https://github.com/Aluxian/Facebook-Messenger-Desktop/issues/458
If still can't do it, please open a new issue


Removed references to non-existing tick.plot.stem and tick.metrics.{f…

…dp, recall} ane removed verbosity from code generating plots in doc and some errors
Solves #84

This was already merged but with pull-merge commits so I've cleaned the whole thing a bit.


“Dropcode.app” can’t be opened because Apple cannot check it for malicious software.

I recently updated to Ventura (Definitely a mistake)
"This software needs to be updated. Contact the developer for more information."
System;
Model Name: MacBook Pro
Chip: Apple M1 Pro
Memory: 16 GB
MacOS: 13.0 (22A380)

Hmm which file did you download?  They all work fine for me, also on Ventura (M1)

Interesting, is there any other debug info I could get?

ok i guess the app has to be notarized, currently it's only signed but not notarized

Fixed https://github.com/egoist/dropcode/releases/tag/v0.0.7


mDNS sends reply to multicast instead of unicast if request source port is 5353 (breaks avahi-resolve) (IDFGH-5375)

Environment

Development Kit: ESP32-DevKitC
Kit version (for WroverKit/PicoKit/DevKitC): v4
Module or chip used:  ESP32-WROOM-32D
IDF version: v4.2.1
Build System: idf.py
Compiler version: xtensa-esp32-elf-gcc (crosstool-NG esp-2020r3) 8.4.0
Operating System: Linux (Debian 11)
Using an IDE?: No
Power Supply:  USB

Problem Description
The mDNS resolution of device name to IP has stopped working in v4.2.1 (don't remember in which version it was OK, maybe v4.0?). Specifically, the ESP IDF mDNS service responds to queries from avahi-resolve -n -4 UBIK-71F164.local with a packet destined to the multicast group <IP_ADDRESS> which is not received by avahi-resolve. As a result avahi-resolve doesn't resolve the name.
As contrast, running dig +short -p 5353 @<IP_ADDRESS> UBIK-71F164.local does resolve the name perfectly. Details and packet capture below.
NB! The problem raises only 2 minutes after ESP32 boots, probably because on boot mDNS broadcasts the relevant info which gets cached by my machine.
The network setup is fairly common, a Technicolor domestic router/AP with ESP32 connected via WiFi and my computer via Ethernet.
Expected Behavior
Running avahi-resolve 2 minutes after ESP32 boot resolves the name to IP:
tarmo@lumi:~$ avahi-resolve -n -4 UBIK-71F164.local -v
Server version: avahi 0.8; Host name: lumi.local
UBIK-71F164.local       <IP_ADDRESS>

Actual Behavior
avahi-resolve fails to resolve the name:
tarmo@lumi:~$ avahi-resolve -n -4 UBIK-71F164.local -v
Server version: avahi 0.8; Host name: lumi.local
Failed to resolve host name 'UBIK-71F164.local': Timeout reached

At the same time dig correctly resolves the name:
tarmo@lumi:~$ dig +short -p 5353 @<IP_ADDRESS> UBIK-71F164.local
<IP_ADDRESS>

Steps to reproduce

Start ESP32, init mDNS and set name per official instructions
Wait 2+ minutes
Run avahi-resolve -n -4 <name>.local
Resolution times out

Code to reproduce this issue
bool NetworkHub::runMdns() {
    esp_err_t result = mdns_init();
    if (ESP_OK != result) {
        err("Fail mDNS init: %s (%d)", esp_err_to_name(result), result);
        return false;
    }
    result = mdns_hostname_set(mTrait.id());
    if (ESP_OK != result) {
        err("Fail mDNS set hostname to [%s]: %s (%d)", mTrait.id(), esp_err_to_name(result), result);
        return false;
    }
    char buf[50];
    const int printed = snprintf(buf, sizeof(buf), "Solar panel inverter/converter %s", mTrait.id());
    assert(printed > 0 && printed < sizeof(buf));
    result = mdns_instance_name_set(buf);
    if (ESP_OK != result) {
        err("Fail mDNS set instance name to [%s]: %s (%d)", buf, esp_err_to_name(result), result);
        return false;
    }
    result = mdns_service_add(nullptr, "_https", "_tcp", 443, NULL, 0);
    if (ESP_OK != result) {
        err("Fail mDNS add service HTTPS: %s (%d)", esp_err_to_name(result), result);
        return false;
    }
    return true;
}

Debug Logs
There is nothing relevant to mDNS in the ESP32 logs.
Initial analysis
A screenshot from Wireshark shows two different mDNS queries (request-response pairs):

First query-response pair is from running dig +short -p 5353 @<IP_ADDRESS> UBIK-71F164.local which successfully resolves the name. You can see that the request's source port is a random ephemeral port 44238. The response is sent as unicast to source IP of resolve query (<IP_ADDRESS>). All good.
Second query-response pair is from running avahi-resolve -n -4 UBIK-71F164.local -v which fails. The request's source port is 5353. The response is sent to multicast group <IP_ADDRESS> instead of source IP of resolve query. Not good.
The packet capture for those 4 packets is here:
packetcapture.zip
I can trace the problem in mDNS source code to this line, which seems to make a decision to "flush" the response if source port is 5353:
https://github.com/espressif/esp-idf/blob/21ecef5c56e01d3cccf0648c869e3fa9248bf3d4/components/mdns/mdns.c#L1254

The cache-flush bit is only set in records in the Resource Record
Sections of Multicast DNS responses sent to UDP port 5353.
The cache-flush bit MUST NOT be set in any resource records in a
response message sent in legacy unicast responses to UDP ports other
than 5353.

Note that neither request sets the unicast response bit.  I don't know if the fact that a unicast response is forced when an alternate port is used is per spec or not.

Thanks for sharing the detailed report, we will look into.

Thanks again for this report and sharing the analysis, this is helpful :+1:
The actual difference between the dig query and the one sent by avahi is not only the source port, but mainly the fact that dig (and some other libraries, lwip, too) sends so called One shot queries defined in https://datatracker.ietf.org/doc/html/rfc6762#section-5.1, whereas avahi is a fully compliant mDNS querier.
The mDNS library doesn't (correctly) support both scenarios, trying to comply with full featured mDNS responder and at the same time responds to lwip mDNS queries introduced MDNS_REPEAT_QUERY_IN_RESPONSE and CONFIG_MDNS_STRICT_MODE configuration options.
Enabling the strict mode in the project configuration menu would make it respond to avahi's queries (after those 2 minute TTLs), but stop responding to dig's (note, that avahi deviates from the spec here, a little, as well: https://datatracker.ietf.org/doc/html/rfc6762#page-14)
Here's a quick fix, which should work for both queriers:
mdns-Support-for-One-Shot-mDNS-queries.patch.txt

I don't know if the fact that a unicast response is forced when an alternate port is used is per spec or not.

https://datatracker.ietf.org/doc/html/rfc6762#section-6.7

Thank you very much for looking into it. My conclusions probably threw a bunch of red herrings on your path, sorry for that.
I confirm that the patch works. I tested on Linux with every tool I could think of (avahi-resolve, dig, ping, Chrome, Firefox). All successfully resolve the name of the patched device. At the same time the unpatched device is not resolved.
Just in case I also booted Windows and tested there (ping, Chrome, Edge) - works like a charm using whatever native thing that does mDNS on Windows. Unfortunately I don't have any Apple devices, so can't test with Mac or iOS.
Side note: the system name resolver on Linux uses avahi (most frequently, systemd also has something which I haven't tested), so if that doesn't resolve my device's name it's quite unfortunate. Can't access the web interface by name, can't ping to verify connectivity. If I access the web interface by IP, the certificate no longer applies so the browser is screaming murder and hackers...

Thanks for reporting, the fix on master branch is available https://github.com/espressif/esp-idf/commit/f601cb0fd73de13f5f23293d99f3e8fdb9c30d6c. We are back porting the fix to release/4.3 and release/4.2. Thanks.

Great news!  Waiting for the backports.

@DaStoned Thanks for being patient while waiting for the fix, fix on release/4.3 has been available https://github.com/espressif/esp-idf/commit/3a588d7d1960b0749727360036f41b48dc7afb80, fix on release/4.2 is now being synchronized onto GitHub, will update once release/4.2 fix is available. Thanks.

Thanks for being patient while waiting for the fix, fix on release/4.2 has been available https://github.com/espressif/esp-idf/commit/93921e042cd8e1c21ad4b39f3f6e6a1f05a69ad2, feel free to reopen if the issue still happens. Thanks.


docs(repo): arrayify docs

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Documentation for arrayify function

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Other information:

#19


Register Diagrams.io as a file handler with the operating system

[x] I agree to follow the Code of Conduct that this project adheres to.
[x] I have searched the issue tracker for a feature request that matches the one I want to file, without success. : I'm duplicating #3230 that was tagged with "Issue template not filled" for which the description says the ticket will be ignored as long as the template is not used.

Is your feature request related to a problem? Please describe.
Diagrams.net can be used as a progressive web app and offers and experience very close to the desktop version. In some environment, we can't install desktop applications but PWA are allowed.
This feature request suggest to have Diagrams.net register as a file handler with the operating system so drawio files can be opened with a PWA version of diagrams.net.
In the absence of this feature:

.drawio files are not associated with applications on my desktop ; it means a double-click on it can't open them :

I must first open the diagrams.net PWA and then open the file from there

Describe the solution you'd like
I'd like a feature like the traditionally file association for the desktop client, but for the PWA. Relevant documentations from browser vendors seems to be:

Edge: https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/handle-files
Chrom(e?ium?): https://developer.chrome.com/en/articles/file-handling/

Describe alternatives you've considered

Install the desktop client -> I can't in my professional IT environment
Tried to modify the file association but it seems it's not an option I can have without being the author of the PWA
Open diagrams.net then open the file, works but could be more efficient

Additional context

This feature request is a duplicate of #3230, but following the template
As I finish writing this ticket, I notice that as of today, an experimental flag is still needed in Edge to see that feature working which I can't enable ; I looked in the source code to see it this was maybe already implemented but it seems not, as manifest.json does not have a file_handlers property.

Unless there has been updates on the matter, I think this is still relevant.

Could this be re-opened?  Or is it better to create a new issue for it?

@davidjgraph Please reopen.
It is still relevant and actionable 🙂


Does zuul support longest prefix matching?

Hi ,
I have two routes like:
/api/v0/  ---> sever 1
/api/v0/user ---> server 2
last time i checked, zuul did not support this kind of routes, it always routed to server 1.  Is this added now?

If you're using spring-cloud-netfix this isn't the right place to ask.

sorry, will ask the on the spring-cloud-netfix board.


Termux compilation tips

I needed it for pytorch compilation. Spent half a day trying to compile this, as dependency. Tips for Termux users only:

If you're compiling this code on Termux and encounter an error about the missing 'unistd.h' file, you might need to install the 'ndk-sysroot'. It has it natively, one of very few apt packages that does not get installed to /opt or .local/lib
Remove this code security cruft first, as it gets stuck eith smth Google. Yes. Thus :

alias cmakeinstall='rm CMakeCache.txt && echo "Removing silly Werror 🪲 directives en masse..." & time find . -type f -exec sed -i "s/-Werror//g" {} \; && export CFLAGS="-fuse-ld=lld  -pthread -g -march=armv8-a -mtune=cortex-a53 -Wall -Wextra"  &&  echo "Starting compilation 👩💻 proper... "&& cmake -DCMAKE_INSTALL_PREFIX=$PREFIX . && time make -j4 && make install'

is my newest one liner.
Ref:
~/downloads/pthreadpool $ uname -a            Linux localhost 4.14.186+ #1 SMP PREEMPT Thu Mar 17 16:28:22 CST 2022 aarch64 Android       ~/downloads/pthreadpool $

PS. You may test it with:
#include <stdio.h>                            #include <pthreadpool.h>                                                                    void task(void* arg, size_t i) {                  printf("Hello from task %zu\n", i);       }                                                                                int main() {                                      pthreadpool_t pool = pthreadpool_create(4);                                                                                pthreadpool_parallelize_1d(pool, (pthreadpool_task_1d_t)task, NULL, 10, 0);                                                               pthreadpool_destroy(pool);                    return 0;                                 }

with : gcc -o test4 test4.c -pthread  -lpthreadpool :
~/.../pytorch/build $ ./test4                 Hello from task 3                             Hello from task 4                             Hello from task 5                             Hello from task 2                             Hello from task 1                             Hello from task 9                             Hello from task 7                             Hello from task 0                             Hello from task 6                             Hello from task 8                             ~/.../pytorch/build $
...

And this is needed:
sed -i '3i set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")' CMakeLists.txt
To covert this fatal error into warning only:
/data/data/com.termux/files/home/downloads/pthreadpool/googlebenchmark-source/src/complexity.cc:85:10: warning: variable 'sigma_gn' set but not used [-Wunused-but-set-variable]
   85 |   double sigma_gn = 0.0;


High Latency To Publish

Hello,
I am using the publish function in a basic way:
const gPubsub = require('@google-cloud/pubsub');
const pubsub = gPubsub({
      projectId: 'projectId',
    });
const publish = (message, cbkPublish) => {
      if (!message.topic)
        return cbkPublish('No PubSub topic specified');
      const topic = message.topic;
      delete message.topic;
      const publisher = pubsub.topic(topic).publisher();
      const buff = Buffer.from(JSON.stringify(message));
      publisher.publish(buff)
        .then(() => cbkPublish(null))
        .catch(err => cbkPublish(err));
    };
    return callback();
  }

The problem is that I am experiencing a long time to publish, for a buffer length of 352 it takes 3608 ms to publish. Is there some settings to publish faster ? Am I doing something wrong ?
Environment Details:
Node: 8.1.4
google-cloud/pubsub: 0.16.5

I have a feeling this is something that will be covered after #92 is merged. @callmehiphop what do you think?

Actually publishing messages does not use the streaming API, so #92 will have no impact on this sadly.
@Turniii I would suggest caching the publisher outside of your function. When you call publish() we start buffering any additional messages and send them all in a batch. If you create a new publisher every time, this would result in all your messages being delayed by 1 second.
I believe you can also lower the duration that we buffer for by setting maxMilliseconds
const publisher = topic.publisher({
  batching: {maxMilliseconds: 500}
});

Hello,
I'm seeing this 1 second delay too and thinking about how I could cache the publisher in a nice way. What strikes me is how I have to send a message to be able to cache the publisher, and how this seems a bit unpractical to me.
Ideally what I'd like to be able to do, is to boot a publisher when my app starts, and then pass it around in the app. But since the order of arguments, probably due to some internal constraints, requires me to set the topic for the publisher to be able to boot it, then this becomes impossible.
Lowering that buffer like specified above, does work but I still think it's reasonable for me to want to cache the publisher without having to send a message first, and preferably also without setting the topic beforehand.
Does that make sense? 🤔

What strikes me is how I have to send a message to be able to cache the publisher, and how this seems a bit unpractical to me

You don't need to send a message to cache the publisher.

Lowering that buffer like specified above, does work but I still think it's reasonable for me to want to cache the publisher without having to send a message first, and preferably also without setting the topic beforehand.

@kir-titievsky I'm not really sure I'm in a place to say, but does @dwickstrom's request seem reasonable to you? Seems simple enough to me and the usage would resemble something like this
const publisher = pubsub.publisher();

// this would throw an error since we haven't set a topic yet
let messageId = publisher.publish(Buffer.from('Hello!'));

// sometime later
const topic = pubsub.topic('my-topic');
publisher.setTopic(topic);

// this would succeed
let messageId = await publisher.publish(Buffer.from('Hello, world!'));

Sure. Although I don’t think we have established that creating and
initializing the publisher takes a significant amount of time. Or did I
miss this?
On Wed, Mar 14, 2018 at 2:00 PM Dave Gramlich<EMAIL_ADDRESS>wrote:

What strikes me is how I have to send a message to be able to cache the
publisher, and how this seems a bit unpractical to me
You don't need to send a message to cache the publisher.
Lowering that buffer like specified above, does work but I still think
it's reasonable for me to want to cache the publisher without having to
send a message first, and preferably also without setting the topic
beforehand.
@kir-titievsky https://github.com/kir-titievsky I'm not really sure I'm
in a place to say, but does @dwickstrom https://github.com/dwickstrom's
request seem reasonable to you? Seems simple enough to me and the usage
would resemble something like this
const publisher = pubsub.publisher();
// this would throw an error since we haven't set a topic yetlet messageId = publisher.publish(Buffer.from('Hello!'));
// sometime laterconst topic = pubsub.topic('my-topic');publisher.setTopic(topic);
// this would succeedlet messageId = await publisher.publish(Buffer.from('Hello, world!'));
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/googleapis/nodejs-pubsub/issues/93#issuecomment-373118518,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARrMFleqUv4o5eet54LNwvSBW492BxRhks5teVrCgaJpZM4SmbPd
.

--
Kir Titievsky | Product Manager | Google Cloud Pub/Sub

Unfortunately I started debating this without reading the source coding or knowing anything about the underlying architecture. But I'd expect an api that let's me understand which calls are expensive, so I can call them as rarely as possible. And so to me that part of the api feels obscured.

Although I don’t think we have established that creating and
initializing the publisher takes a significant amount of time

There has to be some kind of side effect going on, like establishing connections and asserting the topics are registered on the server side, that shouldn't have to be called every time I publish a message. And maybe it isn't, but I don't know that because the api won't let me know, by design.
Either way, I started wondering because I noticed the 1 second delay, which I got down to ~100 ms for the first, and then about ~20 ms for subsequent requests, by setting the buffer to 0. Don't know whether that should be considered "significant".
I ended up swapping Google pubsub for another solution, but still, thanks for replying 🙇

I'm going to close this since the original issue has since been resolved in the latest release.

@kir-titievsky
I am encountering the same problem.
If I make even 33 queries per second to app-engine which after validating publishes them to Pub/sub.
Each request-response cycle of pub/sub takes 170ms to complete. Till that completes, the request remains in App Engine Queue.
As App Engine can hold 80 concurrent requests in the queue per instance and the other instance take some time to spin up, it starts dropping requests and doesn't allow further requests to publish.
This is obviously because of the high latency of pub/sub.
I will appreciate your feedback and suggestions.

@aayusharora Have you tried reducing the publish batch sizes? See https://cloud.google.com/pubsub/docs/publisher#publisher-batch-settings-nodejs for sample. You should set maxMessages=1 and maxMilliseconds = 1.  I'd love a report back on whether this solved the issue.

@kir-titievsky Does that mean, I have to use batching at any cost.
What if I don't want to specify batches and want to process my results in real-time?

No, sorry I was not clear. The opposite: I'm asking you to turn off batching. It is on by default in the client library, if I remember correctly.

Any pointers to turn it off.
I have already removed
batching: {
      maxMessages: maxMessages,
      maxMilliseconds: maxWaitTime,
    },

from the code.

I don't think you can turn it off per se, but you should be able to do something like this
batching: {maxMessages: 1}

Yes, please, @aayusharora  -- don't remove the settings. Set them explicitly. As I said, the default is to batch.

Thanks @kir-titievsky
The average latency is reduced to 80-100 ms from 170ms.
But, still, it's too high if I want to process 16k requests in one second.
As I explained earlier the app engine will allow only 80 concurrent requests in the queue and the other instance will take time to spin up.
The requests in the meantime will drop. Do you have any other suggestions to reduce this latency?
Any help will be highly appreciated !!

Can you point me to the specific limit or quota which on concurrent
requests that you are hitting here?

Maximum quota, I am going to expect 20-30k requests in a second.
The problem with the App Engine Standard Env is " Only 80 concurrent requests are allowed per instance"
Now it will take time to start in a new instance in autoscaling and requests will drop.
The more the latency, the more requests failure will occur and 80-100ms is also huge.

Ah, wait. This is per app engine standard instance.   Why not just have
more instances?
On Tue, Nov 27, 2018 at 11:52 AM Aayush Arora (angularboy) <
<EMAIL_ADDRESS>wrote:

Maximum quota, I am going to expect 20-30k requests in a second.
The problem with the App Engine Standard Env is " Only 80 concurrent
requests are allowed per instance"
Now it will take time to start in a new instance in autoscaling and
requests will drop.
The more the latency, the more requests failure will occur and 80-100ms is
also huge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/googleapis/nodejs-pubsub/issues/93#issuecomment-442133046,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARrMFj_8U41GqH1hVbqQG_jqjIEXFojcks5uzW3qgaJpZM4SmbPd
.

--
Kir Titievsky | Product Manager | Google Cloud Pub/Sub
https://cloud.google.com/pubsub/overview

@kir-titievsky
I already have auto scaling enabled but as you know spinning up the instance take some time.
Even you start with a minimum of two.
What I am interested to know here is, what is the latency of a pub/sub request without even sending any payload ?
This can give me the idea to setup the minimum instances

@kir-titievsky Experiencing the same latency issues, it hovers around ~200 ms regardless of whether we batch or not. Caching the client doesn't seem to affect performance. Any pointers? I'm pasting my test routes verbatim (these have no application logic, nor authentication that could affect performance) for reference.
const express = require ('express'),
  PubSub = require('@google-cloud/pubsub')
;

const Router = express.Router (),

  PubSubClient = new PubSub ({
    projectId: 'xxxxxxx-xxx'
  })
;

Router.get ('/', (request, response, next) => {
  response.render ('index', { title: 'Express' })
})

Router.post ('/singular', async (request, response, next) => {
  const client = PubSubClient
    .topic ('test')
    .publisher ({
      batching: {
        maxMessages: 1,
        maxMilliseconds: 1
      }
    })

  await client
    .publish (Buffer.from (JSON.stringify (request.body)))

  response.json ({ success: true })
})

Router.post ('/batched', async (request, response, next) => {
  const client = PubSubClient
    .topic ('test')
    .publisher ({
      batching: {
        maxMessages: 75,
        maxMilliseconds: 1000
      }
    })

  await client
    .publish (Buffer.from (JSON.stringify (request.body)))

  response.json ({ success: true })
})

const cachedClient = PubSubClient
  .topic ('test')
  .publisher ({
    batching: {
      maxMessages: 1,
      maxMilliseconds: 1
    }
  })

Router.post ('/cached', async (request, response, next) => {
  await cachedClient
    .publish (Buffer.from (JSON.stringify (request.body)))

  response.json ({ success: true })
})

module.exports = Router;

You should set maxMessages=1 and maxMilliseconds = 1. I'd love a report back on whether this solved the issue.

Setting maxMessages = 1 results in another error :
(node: 28) UnhandledPromiseRejectionWarning: Error: The number of elements 1000 exceeds the limit 1000
And the solution I got from the discussion is to set maxMessages: 999. Please check:
https://github.com/googleapis/gax-nodejs/issues/149

Any watchers of this interested in profiling the node client?  Also: are these latency figures coming from request latency metrics reported by Stackdriver or some end-to-end measurements you are doing in the application?
@aayusharora apologies for the delay in response.  I suspect there is some combination of server and client latency here.  It might be worth profiling the client to cut that latency to a minimum, but I think the most important thing here is that you should get a latency that is somewhere between 10ms and 100ms.  Meaning, even under the best circumstances your design choice of relying on App Engine for instant ramp up without keeping "hot" will keep you struggling.
There are a couple solutions here: batch the messages in a concurrent environment (e.g. Go on App Engine flexible environment), so you have only a single long RPC for many messages during spikes.  Or keep more capacity around for App Engine standard.
The reason Pub/Sub takes >10ms to respond to a publish request is that the service is focused on scalable durable messaging: at least once delivery. To achieve that synchronous replication of message across availability zones has to happen.  If you compare this to the latency of say a RabbitMQ cluster or a Kafka broker with async replication, you will of course see this as high latency.  But the benefit is predictability of that performance.
@Prajjwal 200ms seems excessive, although, depends on where you are and if you are seeing this in one off test or continuous high (>>1/second) publishing.  I don't think I'll be able to profile the client in detail to get to the bottom of this in time to be useful for you, but you should be able to get that number down.  Perhaps you are seeing a high rate of errors for some reason so your latency is determined by the retries?

I experienced a similar issue recently. Our use case is to publish a single message to a pubsub topic from within a web client request/response cycle (an express route).
I wrote this test script to evaluate the time it takes to publish a message.
const PubSub = require('@google-cloud/pubsub');

const topicName = 'test-publish-speed-topic';
let savedTopic;
let savedPublisher;
const maxMessages = 1;
const maxMilliseconds = 10;
let totalDuration;
let loopCtr;

const getTopic = async () => {
  if (!savedTopic) {
    const pubsub = new PubSub();
    savedTopic = (await pubsub.topic(topicName).get({autoCreate: true}))[0];
  }
  return savedTopic;
};

const getPublisher = async () => {
  if (!savedPublisher) {
    const topic = await getTopic();
    savedPublisher = topic.publisher({
      maxMessages,
      maxMilliseconds,
    });
  }
  return savedPublisher;
};

const deleteTopic = async () => {
  const topic = await getTopic();
  if (topic) {
    await topic.delete();
    console.log(`topic ${topicName} deleted`);
    return;
  }
  console.log(`topic ${topicName} not found`);
};

const publish = async (data) => {
  const publisher = await getPublisher();

  const start = Date.now();
  await publisher.publish(data);
  const end = Date.now();
  const duration = end - start;
  totalDuration += duration;

  console.log(`publish: dur: ${duration}ms avg: ${totalDuration / loopCtr}ms`);
};

const run = async () => {

  // This will auto-create the topic. Do this before the run
  // so topic creation doesn't influence the results.
  await getTopic();

  // Exercise the publish function and console.log timing results
  totalDuration = 0;
  loopCtr = 1;
  for (; loopCtr <= 1000; ++loopCtr) {
    const data = {"foo": "bar"};
    const dataAsBuffer = Buffer.from(JSON.stringify(data));
    await publish(dataAsBuffer);
  }

  // Cleanup
  await deleteTopic();

};

run();

It takes ~120ms to publish a message using the above test script in cloud shell which is longer than we were hoping for. I reached out to the gcp slack channel and tscanausa tested it on his end using this curl command:
PROJECT='your-project'; TOPIC='your-topic'; curl -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" -X POST https://pubsub.googleapis.com/v1/projects/$PROJECT/topics/$TOPIC:publish -d @data.json -H "Content-Type: application/json" -s -w @curl_format.txt

with similar results. I'm happy to help profile the node client if you think it will help? I tried batching 100 messages at a time and the publish time didn't vary much so it appears to take around 120ms whether I publish 1 message or x messages up to some value of x.

Troy, Thanks for submitting that example. Very helpful.  One thing to note
is that your first publish call to Pub/Sub in XX minutes will generally
take longer since it requires extra information to be retrieved and cached
(e.g. auth bits).  Do you observe comparable latency if you keep publishing?
On Fri, Dec 7, 2018 at 12:34 PM Troy Martin<EMAIL_ADDRESS>wrote:

I experienced a similar issue recently. Our use case is to publish a
single message to a pubsub topic from within a web client request/response
cycle (an express route).
I wrote this test script to evaluate the time it takes to publish a
message.
const PubSub = require('@google-cloud/pubsub');
const topicName = 'test-publish-speed-topic';
let savedTopic;
let savedPublisher;
const maxMessages = 1;
const maxMilliseconds = 10;
let totalDuration;
let loopCtr;
const getTopic = async () => {
if (!savedTopic) {
const pubsub = new PubSub();
savedTopic = (await pubsub.topic(topicName).get({autoCreate: true}))[0];
}
return savedTopic;
};
const getPublisher = async () => {
if (!savedPublisher) {
const topic = await getTopic();
savedPublisher = topic.publisher({
maxMessages,
maxMilliseconds,
});
}
return savedPublisher;
};
const deleteTopic = async () => {
const topic = await getTopic();
if (topic) {
await topic.delete();
console.log(topic ${topicName} deleted);
return;
}
console.log(topic ${topicName} not found);
};
const publish = async (data) => {
const publisher = await getPublisher();
const start = Date.now();
await publisher.publish(data);
const end = Date.now();
const duration = end - start;
totalDuration += duration;
console.log(publish: dur: ${duration}ms avg: ${totalDuration / loopCtr}ms);
};
const run = async () => {
// This will auto-create the topic. Do this before the run
// so topic creation doesn't influence the results.
await getTopic();
// Exercise the publish function and console.log timing results
totalDuration = 0;
loopCtr = 1;
for (; loopCtr <= 1000; ++loopCtr) {
const data = {"foo": "bar"};
const dataAsBuffer = Buffer.from(JSON.stringify(data));
await publish(dataAsBuffer);
}
// Cleanup
await deleteTopic();
};
run();
It takes ~120ms to publish a message using the above test script in cloud
shell which is longer than we were hoping for. I reached out to the gcp
slack channel and tscanausa tested it on his end using this curl command:
PROJECT='your-project'; TOPIC='your-topic'; curl -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" -X POST https://pubsub.googleapis.com/v1/projects/$PROJECT/topics/$TOPIC:publish -d @data.json -H "Content-Type: application/json" -s -w @curl_format.txt
with similar results. I'm happy to help profile the node client if you
think it will help? I tried batching 100 messages at a time and the publish
time didn't vary much so it appears to take around 120ms whether I publish
1 message or x messages up to some value of x.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/googleapis/nodejs-pubsub/issues/93#issuecomment-445307137,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARrMFr26OK0RmfC9Dq2YMo4ArudCnsPvks5u2qbBgaJpZM4SmbPd
.

--
Kir Titievsky | Product Manager | Google Cloud Pub/Sub
https://cloud.google.com/pubsub/overview

I think the latency stays the same but I can double check by running the script a few times back to back.

The latency gradually decreases as the test progresses.
The first publish:
publish: dur: 195ms avg: 195ms

The 1000th publish
publish: dur: 123ms avg: 124.426ms


Added CircleHD to using Snowpack list

Changes
Added CircleHD to using Snowpack list
Testing
Just added logo name and website

Woo! Would love to hear more about how you're using Snowpack at CircleHD


Add a parameter to create the output folder with Swashbuckle.AspNetCore.Cli

When Swashbuckle.AspNetCore.Cli is used, it will fail if the output folder does not exist (e.g. tofile is $(Build.ArtifactStagingDirectory)/documents/api.yaml and we currently only have $(Build.ArtifactStagingDirectory)). It would nice to have a parameter that allows to create the full path if it does not yet exist (like -p with mkdir).

The con is that if the path is incorrect, which often happens with relative paths, then it creates that folder and puts the data into some weird folder location, I dont see this as important feature as it can be achieved with single liner terminal /cmd command

If we did anything here, I think it would be better to not have an option but just have the code do it:
var directoryName = Path.GetDirectoryName(fileName);
if (!Directory.Exists(directoryName))
{
    Directory.Create(directoryName);
}

The above wouldn't handle recursive creation of subdirectories, but it would help.

Duplicate of #2352


Outdated Release Information in Flutter's Release Section

The release section of the Flutter GitHub repository is currently displaying outdated information. It states that the latest release is Flutter 3.16 beta, while the current stable version available is Flutter 3.22.1.
This inconsistency may cause confusion among users who rely on this information to track the latest updates and versions of Flutter. It's essential to keep the release section updated to reflect the current state of the project accurately.
Could the appropriate maintainers please review and update the release section to reflect the correct information, including the latest stable version of Flutter (3.22.1) and any relevant release notes or changes?
Thank you for your attention to this matter.

hey, any update on this?


docs: fix readme links to notification issue

With the trailing ) it ends up going to the issue search section instead, looking for whoever username 49 may be :)

Thanks!


local map algebra functions with bands of different sizes

when I try to run rf_local_add or rf_local_subtract functions with two bands of different sizes as a parameter, I get this error:
Caused by: geotrellis.raster.GeoAttrsError: Cannot combine rasters with different dimensions.(512,512) does not match (256,256) 	at geotrellis.raster.package$TileTupleExtensions.assertEqualDimensions(package.scala:144) 	....`

This is expected behavior. You can use the rf_rescale function to make one of the tiles have the same dimension as the other.
@Atika9 let me know if this solves your issue.

@vpipkt  Thank you.
Yes, the problem is solved using rf_resample function.

@Atika9 I'll go ahead and mark the issue resolved. Feel free to @ me if you think we need to revisit it.


Ability to embed codes

Just like this:
git clone my-repo

Hello @lednhatkhanh,
That's already planned for the next version (see the main README.md)


Fix list Index out of Range in MoveAI

Need a function to handle when all Black Pieces are gone.

The problem occurs when a pawn is at the top/bottom of the board -> that cause the index is out of range. Therefore, something to handle pawn's promotion is needed to fix this problem.


refactor: make ESLint rules stricter

Why

To improve the readability of our code by enforcing coding conventions.
What

[x] update ESLint rules

[x] never omit curly braces around blocks ("curly")
[x] use only arrow functions ("func-style", "prefer-arrow/prefer-arrow-functions")
[x] use only function expression ("func-style")

e.g. const foo = function(){ ... }; or const foo = () => { ... };

[x] reformat code
[ ] update document

[ ] /packages/dts-gen/docs/how-to-use.md

How to test

$ yarn build
$ yarn lint & yarn test

Checklist

[x] Read CONTRIBUTING.md
[ ] Updated documentation if it is required.
[x] Added tests if it is required.
[x] Passed yarn lint and yarn test on the root directory.

We canceled to enforce arrow functions because we need to use a minor third-party plugin.


[Snyk] Security upgrade io.streamnative:pulsar-broker from <IP_ADDRESS> to v2.8.0-rc-202106091140

This PR was automatically created by Snyk using the credentials of a real user.Snyk has created this PR to fix one or more vulnerable packages in the `maven` dependencies of this project.
Changes included in this PR

Changes to the following files to upgrade the vulnerable dependencies to a fixed version:

pom.xml

Vulnerabilities that will be fixed
With an upgrade:

Severity
Priority Score (*)
Issue
Upgrade
Breaking Change
Exploit Maturity

379/1000  Why? Has a fix available, CVSS 3.3
Creation of Temporary File in Directory with Insecure Permissions SNYK-JAVA-COMGOOGLEGUAVA-5710356
io.streamnative:pulsar-broker:  <IP_ADDRESS> -> v2.8.0-rc-202106091140
Yes
No Known Exploit

619/1000  Why? Has a fix available, CVSS 8.1
Authorization Bypass Through User-Controlled Key SNYK-JAVA-ORGAPACHEZOOKEEPER-5961102
io.streamnative:pulsar-broker:  <IP_ADDRESS> -> v2.8.0-rc-202106091140
No
No Known Exploit

661/1000  Why? Recently disclosed, Has a fix available, CVSS 7.5
Uncontrolled Resource Consumption ('Resource Exhaustion') SNYK-JAVA-ORGBOUNCYCASTLE-6084022
io.streamnative:pulsar-broker:  <IP_ADDRESS> -> v2.8.0-rc-202106091140
No
No Known Exploit

(*) Note that the real score may have changed since the PR was raised.
Check the changes in this PR to ensure they won't cause issues with your project.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
🛠 Adjust project settings
📚 Read more about Snyk's upgrade and patch logic

Learn how to fix vulnerabilities with free interactive lessons:
🦉 Creation of Temporary File in Directory with Insecure Permissions
🦉 Uncontrolled Resource Consumption ('Resource Exhaustion')

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


No Json serializer found for type error && not enough arguments for method toJson error

Hello, I am trying to test this codegen example but maybe I am missing something, but I find it hard to follow it straight forwardly, and suspecting maybe this example is not self sufficient example.
What I did was, 1. clone example, 2. build it using 'sbt', 3. run 'swaggerCodeGen, swaggerPlayClientCodeGen, swaggerPlayServerCodeGen' commands in the order, also uncomment in build.sbt the dependency from play-ws. 4. uncomment PetStoreControllerImpl file(The part where it says
// use this code in case of :
// swaggerServerAsync := true)
5. I refactored PetStoreControllerImpl.scala file to same location as where Model.scala is because, in my intelli J the model was not imported properly and giving me red colors.
6. Try to build it. Then I get 8 errors in PetStoreController.scala file, which I wrote in the title.
Am I doing something wrong? or could you fix this problem?
Thank you very much. (below are my error messages)
Error:(12, 21) No Json serializer found for type scala.concurrent.Future[scala.collection.mutable.Seq[swagger.codegen.pet]]. Try to implement an implicit Writes or Format for this type.
Ok(Json.toJson(findPetsImpl(limit, tags)))
^
Error:(12, 21) not enough arguments for method toJson: (implicit tjs: play.api.libs.json.Writes[scala.concurrent.Future[scala.collection.mutable.Seq[swagger.codegen.pet]]])play.api.libs.json.JsValue.
Unspecified value parameter tjs.
Ok(Json.toJson(findPetsImpl(limit, tags)))
Error:(22, 21) No Json serializer found for type scala.concurrent.Future[swagger.codegen.newPet]. Try to implement an implicit Writes or Format for this type.
Ok(Json.toJson(addPetImpl(pet)))
^
Error:(22, 21) not enough arguments for method toJson: (implicit tjs: play.api.libs.json.Writes[scala.concurrent.Future[swagger.codegen.newPet]])play.api.libs.json.JsValue.
Unspecified value parameter tjs.
Ok(Json.toJson(addPetImpl(pet)))
^
Error:(31, 21) No Json serializer found for type scala.concurrent.Future[swagger.codegen.pet]. Try to implement an implicit Writes or Format for this type.
Ok(Json.toJson(deletePetImpl(id)))
^
Error:(31, 21) not enough arguments for method toJson: (implicit tjs: play.api.libs.json.Writes[scala.concurrent.Future[swagger.codegen.pet]])play.api.libs.json.JsValue.
Unspecified value parameter tjs.
Ok(Json.toJson(deletePetImpl(id)))
^
Error:(40, 21) No Json serializer found for type scala.concurrent.Future[Option[swagger.codegen.pet]]. Try to implement an implicit Writes or Format for this type.
Ok(Json.toJson(findPetByIdImpl(id)))
^
Error:(40, 21) not enough arguments for method toJson: (implicit tjs: play.api.libs.json.Writes[scala.concurrent.Future[Option[swagger.codegen.pet]]])play.api.libs.json.JsValue.
Unspecified value parameter tjs.
Ok(Json.toJson(findPetByIdImpl(id)))
^                    ^

Hi!
If you need to generate Play async you need to also uncomment this line:
https://github.com/unicredit/sbt-swagger-codegen-examples/blob/master/build.sbt#L13
and then regenerate the code with:
swaggerClean
swaggerCodeGen
swaggerPlayClientCodeGen
swaggerPlayServerCodeGen

@andreaTP , thanks again for the swift response. With the instructions, I was able to test the code generation and API. (One thing that wasn't explicitly mentioned was I had to refactor PetStoreControllerImpl.scala( in eu.unicredit package) file to same location as where Model.scala( in swagger.codegen package) is because, in my intelli J the model was not imported properly and giving me red colors. So I think it is better to be located with in the same package from the first in my opinion.)
p.s. I found the logic of commented implementations were wrong, which I can elaborate in another issue.

I'm sorry for the integration with IntelliJ, but unfortunatelly IDE doesn't play well with source code generation ....
I double test everything with sbt and it works fine, could you double check that it is just an IDE fault?
p.s.
not sure on how to explain people to implement such a piece of code ... :-S I'm open to suggestions!

I think I had a problem because I didn't know I should have server and client as separate project and should not run both 'swaggerPlayClientCodeGen, swaggerPlayServerCodeGen' in one project. Also I am not sure its because of the update, but now import works normal and no red color. Thanks. And yeah, even though 'sbt' and 'run' works fine, but I see a lot of red colors once I import and try to build from intelliJ, so it doesn't go well with IDE may be. I am closing this now.

The example you tried before wasn't up to date, that's why the errors you encountered. Now that it is updated to the latest version, everything should work again.
And yes, I confirm IntelliJ has problems in coloring generated code (I see red colors too). But this is a fault of IntelliJ, not the code itself.


Problem with incomplete translation into Polish.

I translated your great plugin into Polish.
I'm using Gimp 2.10.14 (from gimp.org) on Win10 64bit and the latest version of Export layers.
Unfortunately, there is a problem with incomplete translation.
For comparison, I checked the French translation - the problem is identical (the same phrases are not translated - although they are included in the * .po and * .mo files).
What could be the reason for the problem?

locale pl_PL.zip

Maybe it will help (after a few attempts);
with the earlier version (but also version number 3.3.1) the translation works correctly.
Working export_layers.py code for translation:
`#! /usr/bin/env python
-- coding: utf-8 --

Export Layers - GIMP plug-in that exports layers as separate images

Copyright (C) 2013-2019 khalim19<EMAIL_ADDRESS>
Export Layers is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Export Layers is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Export Layers.  If not, see https://www.gnu.org/licenses/.
from future import absolute_import, division, print_function, unicode_literals
import inspect
import os
import sys
Fix Windows installation failing to import modules from subdirectories in the
"plug-ins" directory.
if os.name == "nt":
current_module_dirpath = os.path.dirname(inspect.getfile(inspect.currentframe()))
if current_module_dirpath not in sys.path:
sys.path.append(current_module_dirpath)
Disable overlay scrollbar (notably used in Ubuntu) to be consistent with the
Export menu.
os.environ["LIBOVERLAY_SCROLLBAR"] = "0"
from export_layers import pygimplib as pg
from future.builtins import *
import gimpenums
from export_layers import exportlayers
from export_layers import settings_plugin
from export_layers import update
from export_layers.gui import main as gui_main
SETTINGS = settings_plugin.create_settings()
@pg.procedure(
blurb=("Export layers as separate images"),
author="{} <{}>".format(pg.config.AUTHOR_NAME, pg.config.AUTHOR_CONTACT),
copyright_notice=pg.config.AUTHOR_NAME,
date=pg.config.COPYRIGHT_YEARS,
menu_name=("E_xport Layers..."),
menu_path="/File/Export",
parameters=[SETTINGS["special"], SETTINGS["main"]]
)
def plug_in_export_layers(run_mode, image, *args):
SETTINGS["special/run_mode"].set_value(run_mode)
SETTINGS["special/image"].set_value(image)
layer_tree = pg.itemtree.LayerTree(image, name=pg.config.SOURCE_NAME, is_filtered=True)
_setup_settings_additional(SETTINGS, layer_tree)
status = update.update(SETTINGS, run_mode == gimpenums.RUN_INTERACTIVE)
if status == update.ABORT:
return
if run_mode == gimpenums.RUN_INTERACTIVE:
_run_export_layers_interactive(layer_tree)
elif run_mode == gimpenums.RUN_WITH_LAST_VALS:
_run_with_last_vals(layer_tree)
else:
_run_noninteractive(layer_tree, args)
@pg.procedure(
blurb=('Run "{}" with the last values specified').format(pg.config.PLUGIN_TITLE),
description=(
"If the plug-in is run for the first time (i.e. no last values exist), "
"default values will be used."),
author="{} <{}>".format(pg.config.AUTHOR_NAME, pg.config.AUTHOR_CONTACT),
copyright_notice=pg.config.AUTHOR_NAME,
date=pg.config.COPYRIGHT_YEARS,
menu_name=_("E_xport Layers (repeat)"),
menu_path="/File/Export",
parameters=[SETTINGS["special"]]
)
def plug_in_export_layers_repeat(run_mode, image):
layer_tree = pg.itemtree.LayerTree(image, name=pg.config.SOURCE_NAME, is_filtered=True)
_setup_settings_additional(SETTINGS, layer_tree)
status = update.update(SETTINGS, run_mode == gimpenums.RUN_INTERACTIVE)
if status == update.ABORT:
return
if run_mode == gimpenums.RUN_INTERACTIVE:
SETTINGS["special/first_plugin_run"].load()
if SETTINGS["special/first_plugin_run"].value:
_run_export_layers_interactive(layer_tree)
else:
_run_export_layers_repeat_interactive(layer_tree)
else:
_run_with_last_vals(layer_tree)
def _setup_settings_additional(settings, layer_tree):
settings_plugin.setup_image_ids_and_filepaths_settings(
settings["main/selected_layers"],
settings["main/selected_layers_persistent"],
settings_plugin.convert_set_of_layer_ids_to_names, [layer_tree],
settings_plugin.convert_set_of_layer_names_to_ids, [layer_tree])
def _run_noninteractive(layer_tree, args):
main_settings = [
setting for setting in SETTINGS["main"].walk()
if setting.can_be_registered_to_pdb()]
for setting, arg in zip(main_settings, pg.setting.iter_args(args, main_settings)):
setting.set_value(arg)
_run_plugin_noninteractive(gimpenums.RUN_NONINTERACTIVE, layer_tree)
def _run_with_last_vals(layer_tree):
SETTINGS["main"].load()
_run_plugin_noninteractive(gimpenums.RUN_WITH_LAST_VALS, layer_tree)
def _run_export_layers_interactive(layer_tree):
gui_main.ExportLayersDialog(layer_tree, SETTINGS)
def _run_export_layers_repeat_interactive(layer_tree):
gui_main.ExportLayersRepeatDialog(layer_tree, SETTINGS)
def _run_plugin_noninteractive(run_mode, layer_tree):
layer_exporter = exportlayers.LayerExporter(
run_mode, layer_tree.image, SETTINGS["main"])
try:
layer_exporter.export(layer_tree=layer_tree)
except exportlayers.ExportLayersCancelError:
pass
if name == "main":
pg.main()

`

Thank you for translating the plug-in into Polish. May I add it to the plug-in?
As for the French translation, it appears to be out of date - the translation is fully working for the version 2.5. Since 3.0, I vastly overhauled the plug-in UI and consequently modified quite a lot of strings. The placement of many strings also changed as I moved files around (which is why, as you noticed, some identical strings are displayed untranslated).

I used the latest file to translate gimp-plugin-export-layers.pot (3.3.1)
I can only repeat: with the latest version of Export Layers it works only partially - and most oddly with the older version - perfectly.

I was able make the attached Polish translation work by updating the .po file with the latest .pot file from the 4.0 release. I was able to make the procedure names work properly now, except for those that were updated or added after 3.3.1
pl_PL.zip


Added support for different js event handling

Chrome uses the event.srcElement while firefox uses event.currentTarget to get the element that triggered the event. By checking which was present the hover over issue is handled.

Last pull request of UCOSP and no hound or Travis messages :D

Thanks, @spring-ryanc!


zoom info is wrong when zooming out

Hi, i have this code:
svg = SVG('svg').size('100%', '100%').panZoom({panMouse: 2, zoomFactor: 0.03, zoomMin: 0.5, zoomMax: 20});
svg.on('zoom', function(ev) {
    console.log(svg.zoom());
});

When i zoom in i get data from svg.zoom() like this:
1.0300000016911641
1.0599999740677215
1.089999925549374
1.1199998940773055
1.1499998489445757
1.1799998532704519
1.2099998871550262 //Here i stopped zooming in

And that looks OK, but when i zoom out i get this:
1.2399998435183597  //Here i started zooming out, this should be ~1.17999991514276
1.2099998888721086
1.17999991514276

SVG actualy zooms out properly but zoom info is incorrect and it is like 2 steps behind

Thats odd. We use the zoom info ourselves to zoom correctly so this is indeed mysterious.
nvm, i found the problem. The event is fired BEFORE the new zoom is applied. So you read the old value while a new is set. So you actually zoomed into 1.2399998435183597. So its always 1 step behind.
The simple reason is: We want to give the user the possibility to cancel the zoom by calling e.preventDefault(). So the event is fired before the zoom is applied. We should pass the zoomLvl as event details so user know what will be the result of this zoom

@Fuzzyma yea adding zoom info into event data is good idea (actualy i did it in my code, but passing zoom value to event did not fixed a issue for me... i think...)

What is your usecase?

@Fuzzyma When i pass zoom to event data (No other code changes, i have same results):
console.log(svg.zoom(), ev.detail.zoom);

1.0300000005189427 1.0300000005189427
1.059999983825684 1.059999983825684
1.0899999594789196 1.0899999594789196
1.1199999703346117 1.1199999703346117
1.1499999279601947 1.1499999279601947
1.1799999411799356 1.1799999411799356
1.2099999890266275 1.2099999890266275 //Here i stopped zooming in
1.2399999707261578 1.2399999707261578 // Here i started zooming out
1.2099999890266275 1.2099999890266275
1.1799999448995322 1.1799999448995322
1.1499999314930633 1.1499999314930633
1.1199999703346117 1.1199999703346117

This happends in Chromium 60.0.3112.113 Linux x86_64
I use svg.js to create simple SVG editor so i use like 80% of svg.js plugins, but this issue have nothing to do with my code, i called return; right after code sample i posted in issue description.

Thats because the correct "future" zoom is zoom * zoomAmount

@Fuzzyma it is still doing weird stuff :-D I dont have much time to play with it right now... i need to get some sleep, sorry...

@Fuzzyma this is just not fixing anything... number is differend and still wrong...
Ah correct variable i needed is level not zoom, when i pass level to zoom event and use it to scale my grid, everything works ok... finaly

So the trick is to get the zoom after it is actually set. The event however fires before it is set. Thats why you have to use setImmediate() or setTimeout() to execute the code in the event handler after the current chain


Prevent menus from consuming Escape keypresses when fading out

Prevents Menu from blocking Escape keypresses before the menu is finished fading/animating out (after updateState is first called)
For example, opening the osu! song select menu and pressing escape while it is still animating will produce a log message like this:

and it won't close as expected
Also caused this test failure

Couple of things:

How are you determining it's caused that test failure? I can't understand how from reading the logs.
Please add a test for this

Also I'm leaning towards potentially wanting to use Handle*Input => isOpen rather than doing it in the event handler itself.

In that PR, I added a context menu to the Multi RoomsContainer
The test failed because pressing escape failed to close the screen
I was able to narrow down the problem-causing change to the OsuContextMenuContainer, and from there I traced it back to here
I since found that the menu is able to block these presses not due to some "Container loading" but from the menu fading out (as it does in the case of osu!)
I tried using HandleNonPositionalInput like this:

but the keypress still gets blocked when the menu is fading out, so I kept it as-is for now

so I looked at this myself, again, and I'm pretty sure that if we don't want the state check inside OnKeyDown, this seems to be the proper solution:
diff --git a/osu.Framework/Graphics/UserInterface/Menu.cs b/osu.Framework/Graphics/UserInterface/Menu.cs
index 333cff8a1..ccff7d96b 100644
--- a/osu.Framework/Graphics/UserInterface/Menu.cs
+++ b/osu.Framework/Graphics/UserInterface/Menu.cs
@@ -67,6 +67,9 @@ public abstract class Menu : CompositeDrawable, IStateful<MenuState>

         private readonly Container<Menu> submenuContainer;

+        protected override bool ShouldBeConsideredForInput(Drawable child) => State == MenuState.Open;
+        public override bool PropagateNonPositionalInputSubTree => State == MenuState.Open;
+
         /// <summary>
         /// Constructs a menu.
         /// </summary>
@@ -238,6 +241,7 @@ private void updateState()
             {
                 case MenuState.Closed:
                     AnimateClose();
+                    GetContainingInputManager()?.ChangeFocus(null);
                     break;

                 case MenuState.Open:
@@ -480,7 +484,7 @@ private void menuItemHovered(DrawableMenuItem item)

         protected override bool OnKeyDown(KeyDownEvent e)
         {
-            if (state == MenuState.Open && e.Key == Key.Escape && !TopLevelMenu)
+            if (e.Key == Key.Escape && !TopLevelMenu)
             {
                 Close();
                 return true;

PropagateNonPositionalInputSubtree was partly correct, in that it prevents all children of the menu to be included in the input queue.
ShouldBeConsideredForInput is caveat number 1. context menus are positioned inside a ContextMenuContainer, which is a CursorEffectContainer, which is a Container, which is a CompositeDrawable. this is what CompositeDrawable.BuildNonPositionalInputQueue looks like:
https://github.com/ppy/osu-framework/blob/14ee5802cb1e3d6ced37d1511ea55766f2a59e05/osu.Framework/Graphics/Containers/CompositeDrawable.cs#L1291-L1303
therefore, even if the menu itself returns false from its BuildNonPositionalInputQueue (due to returning PropagateNonPositionalInputSubtree = false), not overriding ShouldBeConsideredForInput will mark it back again for inclusion in the queue in its parent. by default ShouldBeConsideredForInput is true.
even after dispatching that, there is caveat number 2, which is the focus change. below is a fragment of InputManager.buildNonPositionalInputQueue():
https://github.com/ppy/osu-framework/blob/c79e4ddf8bdb03783f6b5ec1d2fa23b399e0f90b/osu.Framework/Input/InputManager.cs#L475-L479
turns out the menu doesn't release focus when it's marked as closed, because it's still alive, present and in the hierarchy (at least until the fade out is complete). releasing focus immediately upon close fixes that part, although I'm unsure it will be correct from a UI standpoint.

thanks for looking further into it,
the only necessary changes that I found are:

focus changes to parentMenu rather than null, as with null context menus close immediately after opening and submenus close when hovering, and
adding a check before attempting to change focus, as the game will crash if updateState is called during OnFocusLost (but I don't know whether I'm checking for the right thing, so feedback is needed there)

Test still passes without the two suggestions from @bdach, but only:
        public override bool HandleNonPositionalInput => State == MenuState.Open;

and the ChangeFocus you added.
This means the test is probably not correctly covering the changes.

I actually don't follow the logic of why PropagateNonPositionalInputSubtree or otherwise is required, since we are just blocking the local key handling in the class itself, no?

that's a fair point, I think I actually removed that one and had it still work but then got confused.


Fix a NPD bug in engines/e_dasync.c

The dasync_aes_128_cbc_hmac_sha1 cipher depends on
EVP_aes_128_cbc_hmac_sha1() returning a NON-NULL value.
We should simply not advertise this cipher otherwise.
Fixes: #7950

Aehm, just in case you wanted to ask why this PR is not targeting master:
Engines are generally broken in master, but the dasync engine has another
null-pointer access in the RSA cipher, and unfortunately I have no idea how to fix that one.

24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set.  Please review the updates and set the label manually.

Merged to 1.1.1 as 1be120a
Thanks!


Added tests and documentation

Is this how this should be done? Or is there a way to directly push to your branch and into main mne repo?

@kaichogami I gave you writing permission on my rep, so that you don't have to wait until I confirm merging to the mne rep


receiving a Public Reset in integration tests

See the log file (both server and client in one file): log.txt

This was fixed by https://github.com/lucas-clemente/quic-go/pull/473