Offline feedback and errors for optimistic room rows

Details

I have wrapped the OptionRowLHN and the search OptionRow components in OfflineWithFeedback so they they are grayed out (50% opacity) while pending creation offline, and when creation fails.
I added a pendingAction key and an allReportErrors key to the options for use with the OfflineWithFeedback component. For now I set the pendingAction only for adding the workspace room, but it can be updated to be a combination of more fields in the future.
To set allReportErrors I combined all the error sources related to a report into one big object of error messages keyed by microtime. I set the brickRoadIndicator based on whether allReportErrors is empty.
I also added one new prop to OfflineWithFeedback to handle cases where we want a component to be grayed out when needed, but we don't want to show the error messages under it. Before I achieved that by putting display none of the error messages container. It's better to render the messages only when we need them by setting shouldShowErrorMessages to false.
Related Issues

$ https://github.com/Expensify/Expensify/issues/232287
Tests

Offline success

If needed, create a workspace by clicking the green plus, new workspace
Go offline
Click the green plus, new room
Fill out the form and hit save
Verify that you are navigated to the new room and the whole page is grayed out
Find the room row in the LHN and verify that it is grayed out
Click the search icon in the header and type in the room name, then verify that it is grayed out (50% opacity)
Go online
Verify that the room row in the LHN is not grayed out
Verify that the room row in the search is not grayed out

Offline error

If needed, create a workspace by clicking the green plus, new workspace
Go offline
Click the green plus, new room
Fill out the form with a name (#ffroom), workspace, and hit save
Verify that you are navigated to the new room and the whole page is grayed out
Find the room row in the LHN and verify that it is grayed out
Click the search icon in the header and type in the room name, then verify that it is grayed out (50% opacity)
Close the search page
Sign into the same account on another device or incognito window
Create another workspace room on the same workspace with the same name (#ffroom)
Go back to the other device and go back online
Verify that a red dot shows up on the room row in the LHN and it is grayed out
Verify that a red dot shows up on the room row in search and it is grayed out

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

PR Review Checklist

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 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 included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] iOS / native
[x] Android / native
[x] iOS / Safari
[x] Android / Chrome
[x] MacOS / Chrome
[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 was added in all src/languages/* files
[x] I verified any copy / text that was added to the app is correct English and 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] 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 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 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] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

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

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] 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)
[ ] 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)

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

[ ] iOS / native
[ ] Android / native
[ ] iOS / Safari
[ ] Android / Chrome
[ ] MacOS / Chrome
[ ] 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
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] 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).
[ ] I verified that comments were added to code that is not self explanatory
[ ] 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.
[ ] I verified any copy / text shown in the product was added in all src/languages/* files
[ ] I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
[ ] 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.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] 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)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] 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
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] Any functional components have the displayName property
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] 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)
[ ] 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)
[ ] All JSX used for rendering exists in the render method
[ ] 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

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

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

[ ] 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)
[ ] 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.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

QA Steps

Run the tests above.

[ ] Verify that no errors appear in the JS console

Screenshots

Web

Offline creation pending

Room creation failed grayed out in LHN and search

Mobile Web - Chrome

Offline pending creation success
https://user-images.githubusercontent.com/26260477/194970136-9617a0f6-40c6-40d9-a73d-b19ceb63daff.mov
Creation failed
https://user-images.githubusercontent.com/26260477/194970147-dd3a7346-16ad-4291-9324-81660ea946c7.mov
Mobile Web - Safari

Offline pending creation success
https://user-images.githubusercontent.com/26260477/194969401-d6f1d6e9-8845-4a6d-9ae1-ddb753a24ca9.mp4
Creation failed
https://user-images.githubusercontent.com/26260477/194969367-aec9c1ae-207f-474a-9824-6387ae3574a3.mp4
Desktop

Offline pending creation success
https://user-images.githubusercontent.com/26260477/195216730-505fb005-6450-472b-ad06-44bc2fd011a0.mov
Creation failed
https://user-images.githubusercontent.com/26260477/195216743-1060f31e-8c69-4059-b853-a649192e8666.mov
iOS

Offline pending creation success
https://user-images.githubusercontent.com/26260477/194968404-91eefdb0-128a-4645-abb2-353d65c962f4.mp4
Creation failed
https://user-images.githubusercontent.com/26260477/194968755-9d2952bf-391b-4465-9d80-c31b3e0000bd.mp4
Android

Offline pending creation success
https://user-images.githubusercontent.com/26260477/195216149-fe779434-adff-463e-aaf4-90283bd41781.mov
Creation failed
https://user-images.githubusercontent.com/26260477/195216170-9f0705ca-5bb4-4ebf-bcad-3623d2c7ad79.mov

I still need to check off 2 boxes and figure out why the jest unit tests are failing, but reviews can begin.

I merged main to fix conflicts. Note, I would recommend viewing the diff without whitespace for an easier time reviewing because there are a lot of indentation changes.

Sorry for all the confusion with this PR. Let's get this back on track and moving forward again. Here are my goals.

Gray out optimistic workspace room rows in the LHN and search page while pending creation offline, and when creation fails.
Use OfflineWithFeedback to achieve goal 1 and do so without rendering error messages, instead of hiding them with display none.
Use OfflineWithFeedback to achieve goal 1 without passing all of the possible report errors.
Keep OfflineWithFeedback relatively simple and logical.

Goal 3 is probably a premature optimization as @iwiznia hinted at here. I could do something like this, but that's also strange.
<OfflineWithFeedback
    pendingAction={optionItem.pendingAction}
    errors={!_.isEmpty(optionItem.brickRoadIndicator) ? {hasErrors: true} : null}
    shouldShowErrorMessages={false}
>

I'll go ahead and write a function to get all possible errors on a report, similar to how the errors are accessed in getBrickRoadIndicatorStatusForReport, and then pass all those errors to OfflineWithFeedback. I'll remove the hasErrors prop and the associated changes. The use in OptionRowLHN will look like this.
<OfflineWithFeedback
    pendingAction={optionItem.pendingAction}
    errors={ReportUtils.getAllErrors(props.reportID)}
    shouldShowErrorMessages={false}
>

Does that sound good?

My above plan was approved in Slack here so I'm going to push those changes now.

Ok there's a problem with my plan which is that the OptionRow and OptionRowLHN components do not currently have access to the report and reportActions, which are needed for getAllReportErrors.
I could write getAllReportErrors in OptionsListUtils since it already subscribes to reportActions, and then add an Onyx subscription to ONYXKEYS.COLLECTION.REPORT. However, that violates the convention in that file which is to take in a report parameter.
I could also subscribe to both report and reportActions in ReportUtils, but again that violates convention.
Instead I think I will add a reportErrors key to the option object, and I will set it right above this line.
https://github.com/Expensify/App/blob/d4bcc6209a83fb66ce2ff8d07202748573a19cff/src/libs/OptionsListUtils.js#L294

I'm having trouble writing the getAllReportErrors function. It should return an object of error messages keyed by microtime. To create that I need to merge together report.errors, all errors objects stored under report.errorFields, and all errors objects stored in the report actions.
I've been tinkering around with underscore.js trying to figure out how to do this.

Ready for another review 🙇

Review WIP

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

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] 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)
[ ] 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)

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

[ ] iOS / native
[ ] Android / native
[ ] iOS / Safari
[ ] Android / Chrome
[ ] MacOS / Chrome
[ ] 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
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] 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).
[ ] I verified that comments were added to code that is not self explanatory
[ ] 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.
[ ] I verified any copy / text shown in the product was added in all src/languages/* files
[ ] I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
[ ] 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.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] 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)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] 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
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] Any functional components have the displayName property
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] 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)
[ ] 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)
[ ] All JSX used for rendering exists in the render method
[ ] 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

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

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

[ ] 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)
[ ] 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.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

https://user-images.githubusercontent.com/6829422/197315623-3ce6bb85-7bd9-4ff5-84f4-9a1b743240e3.mov
Mobile Web - Chrome

Mobile Web - Safari

Desktop

iOS

Android

https://user-images.githubusercontent.com/6829422/197315651-15477211-388f-423c-969b-227784a2349b.mov

The code LGTM, I'm still testing on all platforms.
I found a weird behavior that I found on iOS (which probably is not related to this PR) is that the RBR indicator appears after I open the room chat (disabled my mac's wifi):
https://user-images.githubusercontent.com/6829422/197315744-598c7011-0603-4bfa-bdc5-c1bf2df2dee8.mov
And on Safari the error never showed up:
https://user-images.githubusercontent.com/6829422/197315851-62ca817b-26e7-44a2-9f46-6eced663f1b3.mov

Thanks for reviewing and starting the checklist @marcochavezf!

Edit: For some reason the network status is not changing on the iOS simulator when I disabled the wifi (I wonder if there's an issue with the NetInfo library 🤔 ),

Yeah offline testing on the iOS simulator doesn't really work. I had this PR up to add a switch to toggle offline mode for convenient testing, but it never actually got merged. You can try using the changes in that PR for testing. I'll put up another PR for it soon.
Please DM me if you have questions about testing. I'll look into why that jest unit test is not passing.

Cool, thanks @neil-marcellini, I recreated the Android emulator to test on Mobile Chrome and everything looks good 👍🏽

Sweet. I figured out what was wrong with the tests so it should be good to go now!

: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 @neil-marcellini in version: 1.2.20-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by @chiragsalian in version: 1.2.20-3 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


⚠ SceneTime has degraded performance

In fd87a96, SceneTime ($ST) experienced degraded performance:

HTTP code: 200
Response time: 10969 ms

Resolved: SceneTime performance has improved in 094e537 after 6 minutes.


Upgrading the Menu as per cQube Version2

The dashboard menu will be dynamically updated by updating the csv file with data source details.

This problem will be addressed in cQube v5.0.

This is implemented


Update information about spans in Node.js

Due to recent changes on how error tracking and the root spans work, the
docs are updated to fit with those.
Please merge before https://github.com/appsignal/appsignal-nodejs/pull/436. It's the PR that contains the changes described here.

Waiting for a Node.js release. Blocked by PR https://github.com/appsignal/appsignal-nodejs/pull/447


release apk com.facebook.react.common.javascriptexception:null is not an object (evaluating t(r(d[1])).default.direction react native

Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
when i publish the app in play store . it is showing the error. but it is working perfectly in emulator.
React Native version:
React Native Environment Info:
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
Memory: 4.16 GB / 7.91 GB
Binaries:
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Expected Results
Should work in real android device.

Any solution for this issue?? even I am facing this


Check == and <> usages in functions

Reported by otter on 19 Feb 2016 13:31 UTC
In https://trac.modelica.org/Modelica/ticket/1867#comment:41 the following was reported:
The LMS Amesim compiler found several "warnings" related to equality comparison of Real variables. For example, there are lines like if (d_vap <> d_liq) or if abs(m) <= tol or fb == 0.0 . I suspect most other tools just ignore the warnings, like we do. However, it might be nice to clean up as many of them as we can before the v3.2.2 release. This is most likely just a partial list…
Functions that use == comparisons on Real variables:
Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.f3
Modelica.Media.Common.OneNonLinearEquation.solve

Functions that use <> comparisons on Real variables:
Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph
Modelica.Media.Water.IF97_Utilities.waterBaseProp_ps
Modelica.Media.Water.IF97_Utilities.waterBaseProp_pT
Modelica.Media.Water.IF97_Utilities.BaseIF97.Isentropic.hofps4
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterSat_ph
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_ph
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_dT

Although == and <> are allowed in Modelica functions, there might be issues and the functions should be inspected.
I have analyzed the first two (Hubertus, please have a look at the other ones):
Modelica.Media.Common.OneNonLinearEquation.solve
Here the following code is present
 if abs(m) <= tol or fb == 0.0 then
    // root found (interval is small enough)

This code fragment checks whether the interval of the independent variable (abs(m) <= tol) is small enough or whether the residue is exactly zero. If this is the case, the root was found. The "fb == 0.0" is correct here: We cannot use an eps, abs(fb) <= eps, because the "size" of fb is not known (could be very large or very small). However, if the residue is exactly zero, it is impossible to further reduce the x-interval. Therefore, this check must be present.
Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.f3
Here the following code fragement is present:
f.delta := if (d == data.DCRIT and T == data.TCRIT) then
                1 - Modelica.Constants.eps
           else abs(d/data.DCRIT);

Looks a bit surprising to me and it might be better to have an eps here, such as (but I am unsure):
f.delta := if ( abs(d-data.DCRIT)<=eps and
                abs(T-data.TCRIT)<=eps then
                1 - Modelica.Constants.eps
...

Migrated-From: https://trac.modelica.org/Modelica/ticket/1915

Comment by hansolsson on 19 Feb 2016 14:01 UTC
Just so that the previous comment isn't lost:
https://trac.modelica.org/Modelica/ticket/1867#comment:44
It is formally correct Modelica to use equality tests - but it might indicate a problem, and might cause problems for e.g. automatic differentiation.
Consider f3:
  f.delta := if (d == data.DCRIT and T == data.TCRIT) then 1 - Modelica.Constants.eps
     else abs(d/data.DCRIT);

Around the critical density f.delta goes from -1/data.DCRIT to 1/data.DCRIT.
IF we want f.delta to be continuously differentiable we will have to create a complicated expression. I don't know if it is worth it, and I don't see the point in any other change. (I don't even know if we want to differentiate this function in some cases.)

Comment by hansolsson on 19 Feb 2016 15:30 UTC
Replying to [comment:1 hansolsson]:

Just so that the previous comment isn't lost:
https://trac.modelica.org/Modelica/ticket/1867#comment:44
It is formally correct Modelica to use equality tests - but it might indicate a problem, and might cause problems for e.g. automatic differentiation.
Consider f3:
  f.delta := if (d == data.DCRIT and T == data.TCRIT) then 1 - Modelica.Constants.eps
     else abs(d/data.DCRIT);

Around the critical density f.delta goes from -1/data.DCRIT to 1/data.DCRIT.

Oh, sorry - this is wrong.
The f.delta derivative is 1/data.DCRIT both before and after the critical point.
I thought the code was more complicated.
That makes it easier to support automatic differentiation (assuming DCRIT is positive!):
   f.delta := if (d == data.DCRIT and T == data.TCRIT) then 1 - Modelica.Constants.eps
      + (d/DCRIT-1) else abs(d/data.DCRIT);

But that also makes me wonder what problem would f.delta=1 at the critical point cause?

Comment by hubertus on 19 Feb 2016 22:17 UTC
There are derivatives that jump from +1/x to -1/x when crossing the critical point (cp does that). This is a type of function where I would really not recommend to use AD to compute derivatives. In no symbolic math engine that I ever used (Mathematica, Maple, and an open source one) this ever worked properly without my massaging the code manually before and after taking derivatives. That aside, it is worthwhile checking that the current code is fully numerically robust. But it has been used for around 15 years now without me ever getting a bug report on this, so I would strongly prefer to see a failure-example before I change anything.


Fix incomplete upsample dynamo converter

Description

Add missing resize modes.
Fix align_corners handling.
Remove ops from torch_enabled_decompositions.

Unfortunately the converter still won't be in use due to decomposition in PyTorch. See #2729
Fixes #2680
Type of change
Please delete options that are not relevant and/or add your own.

Bug fix (non-breaking change which fixes an issue)

Checklist:

[x] My code follows the style guidelines of this project (You can use the linters)
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas and hacks
[ ] I have made corresponding changes to the documentation
[ ] I have added tests to verify my fix or my feature
[ ] New and existing unit tests pass locally with my changes
[ ] I have added the relevant labels to my PR in so that relevant reviewers are notified

Hi @apbose. I have rewritten the converter registries. Now .default and .vec are registered separately as their schemas are different. Test cases for .default  are also added.
Note that the optional scales* arguments in .default are intentionally not used in our converter, since the output_size argument is not optional and PyTorch has already computed the final output size which can be used directly, as can be seen in the following test script and log.
import torch
import torch_tensorrt

class MyModule(torch.nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, x):
        return torch.nn.functional.interpolate(x, scale_factor=(1.5, 2.5), mode="bicubic")

device = torch.device("cuda", 0)
model = MyModule().eval().to(device)
inputs = [torch.rand((1, 3, 6, 9), dtype=torch.float, device=device)]

with torch.inference_mode():
    optimized_model = torch_tensorrt.compile(
        model,
        ir="torch_compile",
        inputs=inputs,
        enabled_precisions={torch.float},
        debug=True,
        min_block_size=1,
        device=device,
    )

    optimized_model(*inputs)

WARNING:torch_tensorrt.dynamo.conversion.aten_ops_converters:Unable to import quantization op. Please install modelopt library (https://github.com/NVIDIA/TensorRT-Model-Optimizer?tab=readme-ov-file#installation) to add support for compiling quantized models
INFO:torch_tensorrt.dynamo.utils:Using Default Torch-TRT Runtime (as requested by user)
INFO:torch_tensorrt.dynamo.utils:Compilation Settings: CompilationSettings(enabled_precisions={<dtype.f32: 7>}, debug=True, workspace_size=0, min_block_size=1, torch_executed_ops=set(), pass_through_build_failures=False, max_aux_streams=None, version_compatible=False, optimization_level=None, use_python_runtime=False, truncate_double=False, use_fast_partitioner=True, enable_experimental_decompositions=False, device=Device(type=DeviceType.GPU, gpu_id=0), require_full_compilation=False, disable_tf32=False, assume_dynamic_shape_support=False, sparse_weights=False, refit=False, engine_capability=<EngineCapability.STANDARD: 1>, num_avg_timing_iters=1, dla_sram_size=1048576, dla_local_dram_size=1073741824, dla_global_dram_size=536870912, dryrun=False, hardware_compatible=False)

DEBUG:torch_tensorrt.dynamo.backend.backends:Pre-AOT Autograd graph:
graph():
    %l_x_ : torch.Tensor [num_users=1] = placeholder[target=L_x_]
    %interpolate : [num_users=1] = call_function[target=torch.nn.functional.interpolate](args = (%l_x_,), kwargs = {scale_factor: (1.5, 2.5), mode: bicubic})
    return (interpolate,)
DEBUG:torch_tensorrt.dynamo.lowering._repair_input_aliasing:Inserted auxiliary clone nodes for placeholders:
graph():
    %l_x_ : torch.Tensor [num_users=1] = placeholder[target=L_x_]
    %clone_default : [num_users=1] = call_function[target=torch.ops.aten.clone.default](args = (%l_x_,), kwargs = {})
    %interpolate : [num_users=1] = call_function[target=torch.nn.functional.interpolate](args = (%clone_default,), kwargs = {scale_factor: (1.5, 2.5), mode: bicubic})
    return (interpolate,)
DEBUG:torch_tensorrt.dynamo.lowering._remove_sym_nodes:Removed SymInt placeholders:
graph():
    %l_x_ : torch.Tensor [num_users=1] = placeholder[target=L_x_]
    %clone_default : [num_users=1] = call_function[target=torch.ops.aten.clone.default](args = (%l_x_,), kwargs = {})
    %interpolate : [num_users=1] = call_function[target=torch.nn.functional.interpolate](args = (%clone_default,), kwargs = {scale_factor: (1.5, 2.5), mode: bicubic})
    return (interpolate,)
DEBUG:torch_tensorrt.dynamo.lowering.passes.remove_detach:Removed 0 detach nodes:
graph():
    %l_x_ : torch.Tensor [num_users=1] = placeholder[target=L_x_]
    %clone_default : [num_users=1] = call_function[target=torch.ops.aten.clone.default](args = (%l_x_,), kwargs = {})
    %interpolate : [num_users=1] = call_function[target=torch.nn.functional.interpolate](args = (%clone_default,), kwargs = {scale_factor: (1.5, 2.5), mode: bicubic})
    return (interpolate,)
DEBUG:torch_tensorrt.dynamo.backend.backends:Post-AOT Autograd graph:
graph():
    %arg0_1 : [num_users=1] = placeholder[target=arg0_1]
    %clone : [num_users=1] = call_function[target=torch.ops.aten.clone.default](args = (%arg0_1,), kwargs = {})
    %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%clone, [9, 22], False, 1.5, 2.5), kwargs = {})
    return (upsample_bicubic2d,)
DEBUG:torch_tensorrt.dynamo.lowering.passes.remove_input_alias_fixing_clones:Removing node clone from graph, since it is a clone node which is the only user of placeholder arg0_1 and was inserted by the compiler.
DEBUG:torch_tensorrt.dynamo.lowering.passes.remove_input_alias_fixing_clones:Removed auxiliary clone nodes for placeholders:
graph():
    %arg0_1 : [num_users=1] = placeholder[target=arg0_1]
    %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%arg0_1, [9, 22], False, 1.5, 2.5), kwargs = {})
    return (upsample_bicubic2d,)
DEBUG:torch_tensorrt.dynamo.lowering.passes.constant_folding:Graph after constant folding:
graph():
    %arg0_1 : [num_users=1] = placeholder[target=arg0_1]
    %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%arg0_1, [9, 22], False, 1.5, 2.5), kwargs = {})
    return (upsample_bicubic2d,)
DEBUG:torch_tensorrt.dynamo.backend.backends:Lowered Input graph:
 graph():
    %arg0_1 : [num_users=1] = placeholder[target=arg0_1]
    %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%arg0_1, [9, 22], False, 1.5, 2.5), kwargs = {})
    return (upsample_bicubic2d,)
DEBUG:torch_tensorrt.dynamo.partitioning._global_partitioner:
Supported Nodes:
- torch.ops.aten.upsample_bicubic2d.default + Operator Count: 1

DEBUG:torch_tensorrt.dynamo.partitioning._global_partitioner:
All Nodes Supported

DEBUG:torch_tensorrt.dynamo._compiler:Detected support for 1 operators out of 1 in subgraph.
DEBUG:torch_tensorrt.dynamo.partitioning._adjacency_partitioner:
Number of TensorRT-Accelerated Engines Generated: 1
DEBUG:torch_tensorrt.dynamo.partitioning._adjacency_partitioner:
Supported Nodes:
- torch.ops.aten.upsample_bicubic2d.default + Operator Count: 1

DEBUG:torch_tensorrt.dynamo.partitioning._adjacency_partitioner:
All Nodes Supported

DEBUG:torch_tensorrt.dynamo._compiler:Submodule name: _run_on_acc_0
 Input shapes: [(1, 3, 6, 9)]
 graph():
    %arg0_1 : [num_users=1] = placeholder[target=arg0_1]
    %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%arg0_1, [9, 22], False, 1.5, 2.5), kwargs = {})
    return upsample_bicubic2d
INFO:torch_tensorrt [TensorRT Conversion Context]:[MemUsageChange] Init CUDA: CPU +2, GPU +0, now: CPU 12954, GPU 1009 (MiB)
INFO:torch_tensorrt [TensorRT Conversion Context]:[MemUsageChange] Init builder kernel library: CPU +2637, GPU +308, now: CPU 15854, GPU 1317 (MiB)
DEBUG:torch_tensorrt.dynamo.conversion._TRTInterpreter:Adding input to in-progress INetwork: arg0_1 [shape=[1, 3, 6, 9], dtype=DataType.FLOAT]
DEBUG:torch_tensorrt.dynamo.conversion._TRTInterpreter:Converting node upsample_bicubic2d (kind: aten.upsample_bicubic2d.default, args: ('arg0_1 <tensorrt.ITensor [shape=(1, 3, 6, 9), dtype=DataType.FLOAT]>', [9, 22], False, 1.5, 2.5))
DEBUG:torch_tensorrt.dynamo.conversion._TRTInterpreter:Marking output output0 [shape=(1, 3, 9, 22), dtype=DataType.FLOAT]
INFO:torch_tensorrt.dynamo.conversion._TRTInterpreter:TRT INetwork construction elapsed time: 0:00:00.000977
INFO:torch_tensorrt [TensorRT Conversion Context]:Global timing cache in use. Profiling results in this builder pass will be stored.
INFO:torch_tensorrt [TensorRT Conversion Context]:Detected 1 inputs and 1 output network tensors.
INFO:torch_tensorrt [TensorRT Conversion Context]:Total Host Persistent Memory: 0
INFO:torch_tensorrt [TensorRT Conversion Context]:Total Device Persistent Memory: 0
INFO:torch_tensorrt [TensorRT Conversion Context]:Total Scratch Memory: 0
INFO:torch_tensorrt [TensorRT Conversion Context]:Total Activation Memory: 0
INFO:torch_tensorrt [TensorRT Conversion Context]:Total Weights Memory: 0
INFO:torch_tensorrt [TensorRT Conversion Context]:Engine generation completed in 0.0770113 seconds.
INFO:torch_tensorrt [TensorRT Conversion Context]:[MemUsageStats] Peak memory usage of TRT CPU/GPU memory allocators: CPU 0 MiB, GPU 1 MiB
INFO:torch_tensorrt [TensorRT Conversion Context]:[MemUsageStats] Peak memory usage during Engine building and serialization: CPU: 3522 MiB
INFO:torch_tensorrt [TensorRT Conversion Context]:Serialized 26 bytes of code generator cache.
INFO:torch_tensorrt [TensorRT Conversion Context]:Serialized 1 timing cache entries
INFO:torch_tensorrt.dynamo.conversion._TRTInterpreter:Build TRT engine elapsed time: 0:00:00.079129
INFO:torch_tensorrt.dynamo.conversion._TRTInterpreter:TRT Engine uses: 10732 bytes of Memory
DEBUG:torch_tensorrt.dynamo._DryRunTracker:
++++++++++++++++++++++++++++++++++++++++++++++++++ Dry-Run Results for Graph ++++++++++++++++++++++++++++++++++++++++++++++++++

The graph consists of 1 Total Operators, of which 1 operators are supported, 100.0% coverage

Compiled with: CompilationSettings(enabled_precisions={<dtype.f32: 7>}, debug=True, workspace_size=0, min_block_size=1, torch_executed_ops=set(), pass_through_build_failures=False, max_aux_streams=None, version_compatible=False, optimization_level=None, use_python_runtime=False, truncate_double=False, use_fast_partitioner=True, enable_experimental_decompositions=False, device=Device(type=DeviceType.GPU, gpu_id=0), require_full_compilation=False, disable_tf32=False, assume_dynamic_shape_support=False, sparse_weights=False, refit=False, engine_capability=<EngineCapability.STANDARD: 1>, num_avg_timing_iters=1, dla_sram_size=1048576, dla_local_dram_size=1073741824, dla_global_dram_size=536870912, dryrun=False, hardware_compatible=False)

  Graph Structure:

   Inputs: List[Tensor: (1, 3, 6, 9)@float32]
    ...
    TRT Engine #1 - Submodule name: _run_on_acc_0
     Engine Inputs: List[Tensor: (1, 3, 6, 9)@float32]
     Number of Operators in Engine: 1
     Engine Outputs: Tensor: (1, 3, 9, 22)@float32
    ...
   Outputs: Tuple(Tensor: (1, 3, 9, 22)@float32)

  ------------------------- Aggregate Stats -------------------------

   Average Number of Operators per TRT Engine: 1.0
   Most Operators in a TRT Engine: 1

  ********** Recommendations **********

   - For minimal graph segmentation, select min_block_size=1 which would generate 1 TRT engine(s)
   - The current level of graph segmentation is equivalent to selecting min_block_size=1 which generates 1 TRT engine(s)
WARNING: [Torch-TensorRT] - Using default stream in enqueueV3() may lead to performance issues due to additional calls to cudaStreamSynchronize() by TensorRT to ensure correct synchronization. Please use non-default stream instead.

Thanks for the PR and the detailed explanations @HolyWu . I had a doubt in the above I see the signature
 %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%arg0_1, [9, 22], False, 1.5, 2.5), kwargs = {})
So as you said the output shape is mentioned always, but isn't the scale_factor [1.5,2.5] ? What does 1.5, 2.5 denote in the above?

Thanks for the PR and the detailed explanations @HolyWu . I had a doubt in the above I see the signature  %upsample_bicubic2d : [num_users=1] = call_function[target=torch.ops.aten.upsample_bicubic2d.default](args = (%arg0_1, [9, 22], False, 1.5, 2.5), kwargs = {}) So as you said the output shape is mentioned always, but isn't the scale_factor [1.5,2.5] ? What does 1.5, 2.5 denote in the above?

In the schema, they are scales_h and scales_w arguments, respectively.

LGTM! @HolyWu  could you rebase the PR? Pending on CI.

I'll add supports_dynamic_shape argument to the decorator and corresponding tests for dynamic shape since I'm at it.

Dynamic support has been added. I also managed to override PyTorch's CompositeImplicitAutograd dispatch key so users of torch.nn.functional.interpolate can actually use these converters rather than get decomposed operators.

LGTM. Tests were successful on my local build. they are running on TRT engine as expected.


Add mock testing

Goal
Mock the connections to Azure, and check that the functions that make API calls to Azure are called with the correct arguments.
Context
Mocking provides a handy way to check that our code makes specific calls to Azure, without actually making those calls. This is very handy for adding local tests that can run quickly. Adding in mock calls will give us more confidence that the code making API calls to Azure is correct.
Required features

Add mock tests for the helpers module as a starting point

Specifications

[ ] Ideally one test per helper function.

Out of scope

Actually connecting to Azure. I'll make another issue for e2e testing.

Related documents

a useful intro to mocking

https://github.com/CDCgov/cfa_azure/pull/123


Loss of precision when updating datetime

I notice that datetime OneDrive API returns is of format like "2015-02-23T19:02:31.433Z", so when calling API to update lastModified time I give strings of the same format. But I got error
[item] Cannot convert the literal '2015-10-05T02:24:27' to the expected type 'Edm.DateTimeOffset'. (invalidRequest).

Of course I can remove the microsecond part from the string at the expense of precision, but can't the API preserve the precision correctly? Or am I doing something wrong?

Hey @xybu do you have a sample request that hits this? It works for me when I send a timestamp back in the same format - make sure yours looks like what we return including the Z at the end to indicate UTC.

Closing out due to lack of response. Please reopen if you have more information.


Include functools.wraps in wrapers.py  for projects using sphinx and numba decorators.

Feature request
If I use one of the numba decorators (e.g.) njit on a function and later use sphinx autodoc to generate documentation for my project, the signature of this function will be missing in the docs. According to https://github.com/sphinx-doc/sphinx/issues/3783 the signature is correctly included if the decorator uses  functools.wraps.
Would it be possible for you to include  @wraps in your decorators so that users could easily
use numba and sphinx together in their projects?

@pordyna thank you for your feature request. I just had a quick look, and it would appear, that we already support this.
From the page: https://docs.python.org/3.7/library/functools.html - wraps just calls update_wrapper and update_wrapper is called in Numba in the Dispatcher:
https://github.com/numba/numba/blob/master/numba/dispatcher.py#L550
A good way to check if it is working is to check the dunder methods which update_wrapper sets, such as __name__, __doc_, __wrapped__ etc..:
In [1]: from numba import njit

In [2]:

In [2]: @njit
   ...: def foo():
   ...:     """ This is it """
   ...:     return 1
   ...:

In [3]: foo.__module__
Out[3]: '__main__'

In [4]: foo.__name__
Out[4]: 'foo'

In [5]: foo.__qualname__
Out[5]: 'foo'

In [6]: foo.__annotations__
Out[6]: {}

In [7]: foo.__doc__
Out[7]: ' This is it '

In [8]: foo.__wrapped__
Out[8]: <function __main__.foo()>

In [9]: foo.__wrapped__.__name__
Out[9]: 'foo'

In [10]: foo.__wrapped__.__doc__
Out[10]: ' This is it '

So anyway, I think it should  work fine. If you are having a specific issue with using Sphinx on your project that uses Numba, maybe you could send a link?

Alright, thank you for the fast answer.  Then it's probably sth with my sphinx configuration, I'll look into it.

@pordyna no problem. I will close this issue for now. Please feel free to open it again in case you don't find the snag.


How do I add a new component to the mapping?

💬 Question
I am creating a component for the library, it is already working, however, when I went to add the styles using the styled function I received the following error:
"Pagination: unsupported configuration. Using UI Kitten components is only possible with configuring ApplicationProvider. [...] In the case you have all in place, there might be an incorrect usage of a 'styled' function."
I'm using Kitten Tricks to test the component I'm creating and running with yarn demo start:dev
UI Kitten and Eva version

Package
Version

@eva-design/eva
2.0.0

@ui-kitten/components
5.0.0

👋
Here is a guide

Actually this is not for my case, I am creating a component for the library (help to solve an issue), and not for a project of mine

If you're building for the library, it assumes that the library user should run it as a plugin above UI Kitten components. Your library user will still have to wrap the root component in ApplicationProvider so that the component can be given processed stylings, what actually ApplicationProvider does.


Disable Life Server

Hello,
would it be possible to disable the live server, I do not need it and it takes a long time to start. VSCode always shows me a warning message because of this.
I use the add-on only to compile sass, there is no better add-on for that either

Hi @Tealk,
Sorry for the delay, been crazy and the email from GitHub went into my junk for some reason.
I actually have a branch for v5. It's not ready for a full release, but I have removed the Live Server dependency and created an alpha for direct download.
There is a .vsix file that you can download, just click the file (currently live-sass-5.0.0-alpha.1.vsix) and then click download. Then drag the file into the extensions tab of VS Code. You will need to relaunch for the update to take affect. You will also have to manually uninstall Live Server.
An issue was already raised at #23, so I'll mark this as duplicate and close it.
Thanks


add today alias for curday function

What type of PR is this：

[ ] bugfix
[ ] feature
[ ] enhancement
[ ] refactor
[ ] others

Which issues of this PR fixes ：

Fixes #
Problem Summary(Required) ：

Checklist:

[ ] I have added test cases for my bug fix or my new feature
[ ] I have added user document for my new feature or new function

Thanks for contributing to StarRocks!
We have done some research on this function. It seems that almost all databases use 'current' related function name.
Hive:  current_date https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-get_json_object

Thanks for contributing to StarRocks!
We have done some research on this function. It seems that almost all databases use 'current' related function name.
Hive: current_date https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-get_json_object
PostgreSQL: current_date https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
MySQL: current_date https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html
snowflake: current_date https://docs.snowflake.com/en/sql-reference/functions/current_date.html
trino: current_date https://trino.io/docs/current/functions/datetime.html
presto: current_date https://prestodb.io/docs/current/functions/datetime.html
Also, curdate is an identical expression with other functions in StarRocks like: curtime, current_timestamp, current_user, current_version, etc. So we would like to use curdate, it's more user-friendly.
Thanks for your contribution again, we would be happy to merge this alias if it's a common expression for all users. However, it seems that 'current' related expression is the common expression. If it is more convenient for you to use 'today',  you can add an alias in your repo.


The expanded size of the tensor (256000) must match the existing size (253924) at non-singleton dimension 1.  Target sizes: [2, 256000].  Tensor sizes: [253924]

The shape of my images is:
C.image_height = 1596
C.image_width = 2552
I set
C.target_size = 1024
C.base_size = 832
Is the question below related to my config?
Question:
Traceback (most recent call last):
File "train.py", line 127, in
loss = model(imgs, gts)
File "/home/work/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/work/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 141, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/work/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/work/yhy/TorchSeg/model/bisenet/license_plate.bisenet.X39.speed/network.py", line 107, in forward
aux_loss0 = self.ohem_criterion(self.heads0, label)
File "/home/work/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/work/yhy/TorchSeg/furnace/seg_opr/loss_opr.py", line 79, in forward
prob = prob.masked_fill_(1 - valid_mask, 1)
RuntimeError: The expanded size of the tensor (256000) must match the existing size (253924) at non-singleton dimension 1.  Target sizes: [2, 256000].  Tensor sizes: [253924]

image dimension should be multiple of power of 2.

image dimension should be multiple of power of 2.

Thanks for your reply! I've solved this problem by using the image dimension (1024,1024) in the original config instead of my image dimension.

image dimension should be multiple of power of 2.

Thanks for your reply! I've solved this problem by using the image dimension (1024,1024) in the original config instead of my image dimension.


feat(codemagic_app_preview): use download icon for macOS

⬇ Generated builds by Codemagic for commit d80be117d2eb39cec16eba573e2de1148cfd2230 ⬇
This is a custom message.

iOS
Android
macOS

  Download link
  Download link
  Download link


As developers, we want to discuss whether or not to use integration test or UI test to test our un-/following feature.

Integration tests:

Could for example seed example database, with e.g. Bella follows Cheryl, and both of them have example cheeps.
When asking a certain repository that Anna wants to follow both Bella and Cheryl, to circumvent that Anna has to be logged into Chirp!
Test repositories in isolation.

UI tests:

Is done with Playwright. (some of them)
Okay that the Playwright tests are not integrated into your github actions workflows. Can be done, but a bit more difficult to do.
Should be able to execute them locally when checking out of the main branch of your repository.

Acceptance Criteria:

Decide whether or not we want to use integration or UI tests.

We have decided to try to implement Playwright and UI test, and if we aren't able to properly implement it, we will instead use integration testing.


chore(main): release 0.9.0

:robot: I have created a release beep boop
0.9.0 (2024-11-08)
Features

added building (ec69a1e)
new building (abc1ae7)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v0.9.0
:sunflower:


[tool.pdm.version] source = "scm" breaks when package is installed from git

pyproject.toml:
[project]
name = "test"
version = "0.0.0"
requires-python = "~=3.8"
dependencies = [
  "amaranth @ git+https://github.com/whitequark/amaranth@pdm-build"
]

After installing:
$ pdm install; pdm list
All packages are synced to date, nothing to do.
Installing the project as an editable package...
  ✔ Update test 0.0.0 -> 0.0.0 successful

🎉 All complete!

╭────────────┬──────────────────────┬─────────────────────────╮
│ name       │ version              │ location                │
├────────────┼──────────────────────┼─────────────────────────┤
│ MarkupSafe │ 2.1.3                │                         │
│ pyvcd      │ 0.4.0                │                         │
│ amaranth   │ 0.1.dev1323+ga0a3c07 │                         │
│ test       │ 0.0.0                │ -e /home/whitequark/tmp │
│ Jinja2     │ 3.1.2                │                         │
╰────────────┴──────────────────────┴─────────────────────────╯

The version is 0.1.dev1323+ga0a3c07 but it should be 0.4.devSomething.
Note that setuptools_scm handles this correctly.

It coudn't find any git tags on the repo https://github.com/whitequark/amaranth
How can it be 0.4.devSomething?

Oh, you're completely right. I extracted this from a larger example that used a pull request, but the exact same thing happened there. Sorry for the false alarm!


Added support for Mock XML request and responses.

I have added support for Mock XML request and responses. I still need to implement Unit Tests for new implemented API's. I have made sure the existing Unit Tests are passing fine.
Feedback is most welcome.

@gagarwal: This looks great. Some minor organization and naming changes. Also, please add test cases.
Sorry for the long delay in looking at this. I’ve been rather busy at work lately.

Fixed your code review comments. Still need to add Unit Tests.

@gagarwal Any update on the unit tests?

@Dfowj Sorry I didn't got any time to work on this.

@gagarwal Checking in on this PR - do you anticipate having the time to write tests for this anytime soon?

I am sorry, I do not have bandwidth to write them. So sorry.

@gagarwal No worries - unfortunately we won't be able to merge this until we have test coverage. However, since getting this merged isn't super urgent, we can wait until you or someone else has time to write the tests for this.


Implement node 6 features

Implements the node 6 functions:

prependListener
prependOnceListener
eventNames

It also adds similar prepend methods that are specific to this library:

prependMany
prependAny

There are tests, documentation and typescript defs.
note

I moved the maxListeners property of the _events object. This seemed like bad design to mix this with event names (e.g. when someone actually wants to have a maxListeners event).
The eventNames function is not fully compatible with the node implementation. That's because the node implementation uses Reflect.keys instead of Object.keys. The former has not so much browser support and since you guys don't have any transpiler infrastructure, I choose to use Object.keys instead for the time being.

Fixes: https://github.com/asyncly/EventEmitter2/issues/208

Yep, don't know why I named it _addAny.

Thank you so much for the additions! I've released in in version 4.0.0


Drop instruction call

It is always possible to emulate unconditional call using conditional if_then_call.
push 1
if_then_call label
nop nop

Let's close this issue and let the answer be made as whether we merge or close #84.


Command Center does not work well with default window title

Does this issue occur when all extensions are disabled?: Yes/No
Yes

VS Code Version: 1.74.3
OS Version: Windows 10 21H2

Steps to Reproduce:
if you have changed it, the default title is: ${dirty}${activeEditorShort}${separator}${rootName}${separator}${appName}
title settings path is "window->title"

right click on the title bar and disable Command Center
open settings and change the title to this default
open a folder, and observe the title shows the "Settings - folder name - Visual Studio Code"
right click title bar, enable CC and observer it shows only the folder name.
get back to title setting and add a single letter or symbol to the beginning and observe CC now shows full title
remove that addition and observe CC does not respect the default title

When I run 1.74.3 for the first time to test some other bugfix, as portable, I thought VSCode started deviating from distributing same settings. It was my first time seeing CC. Then saw a "show together with title" and then thought title bar does not even show up. Some thinkering and I got to these steps to reproduce the issue.
most of VSCode users do not tamper with settings until they really need, this issue poses a threat to un-suspecting. as CC now seems to come enabled by default, so it really is important to fix this annoying issue as soon as possible.

That was a conscious decision because the CC is more space limited

Hi @jrieken,
It might be conscious, but "limited space" is very arguable.
I use an old laptop (windows) with a 1366x768 display size, and CC has a lot of room to show a lengthy title as you can see below. Most modern screens provides much more space than mine.
full-screen title bar (about 1300px with vertical taskbar)

CC is also available only when title bar is in "custom" mode, and when the window shrinks the menu bar also shrinks to the hamburger menu leaving room for the title. (These are on Windows but holds true for the Web editor at vscode.dev). The following ones crop the application name, but still have better information than just showing the folder/project name.
half-screen title bar (about 650px)

half-screen minus layout buttons (again 650px)

This last image shows Command Center has a minimum size dependent on the whole window size. Instead, it can be made flexible in size to take up the remaining space on the bar, for example.
Or it can be completely separated from the title itself, have a defined size, and sit on the title bar just like the menu bar and layout controls.
Another issue here is the impact CC will have on newcomers. The current title bar provides little but more valuable information than just having a static application name. It is not immediately noticeable but this ever-changing title generates an intuition in new users. It is sure CC has a lot of features to use but it seems to come enabled by default now, and this issue in title visualization certainly cripples this side of users' self-development.

Hi @jrieken ,
I was working with workspace profiles and noticed the title bar now shows at full length. The default string is now even longer with the profile name in it, while still being fine at half-screen width.
It is 17.5.x and I assume the limitation you mentioned was removed. Can you please check the situation?
If this change is to stay with us, then you can mark the issue as solved.


fix broken profile component

Overview
Gets and sets the logged in user's profile information
Demo
Optional. Screenshots, curl examples, etc.
Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions

Log in
View your profile information

These files use 4 instead of 2 spaces for formatting. Other than that this LGTM.


Convergence criteria for optimizers

Many optimization frameworks provide an optional argument - tol or tolerance that lets one stop optimization if the function, gradient or parameter does not change much for a given iteration. This is used in conjunction with a parameter max_iter for a hard upper bound on the number of iterations the optimizer is to be run for.
The optimizers in the autograd package currently do not support this.

Are there plans of implementing this functionality?
If not, would it be a good idea for me to go ahead and implement this or do you feel that the increased computational complexity isn't worth it?

Thanks and great work on the package. Just used this for an assignment and it is really powerful!
A more navigable documentation would be great though.

Two ways that I thought this could be done are:

tol as a user passed argument. Actual computation and checking happens on each iteration
This is slower but provides a richer interface to the user
Return value of the callback function is checked as an exit criteria
Existing code is unaffected. Library users are free to implement any kind of convergence criteria


Split the SGB documentation into chapters

I've split the SGB single "massive page" into multiple chapters. Should make it easier to browse and look up things.
I did not change a single letter in the contents itself, only split it. Chapters are now setup as:

Note that this will conflict with #309

At a glance, the split appears reasonable. May need tweaking later on, but this is a very good step in the right direction :)

There is a lot more room for improvement. Like many of the "tables" in the SGB section are just code blocks would be a simple cleanup for someone to do as well.

We already have #87 for that one, but it can (should) be tackled in a separate PR.


noEmit or isInvalidated option / interop with vercel's Ignore Build Step feature

Describe the feature you'd like to request
Essentially want to be able to run turbo and have it tell me if anything has been invalidated, but not actually build anything.
Similar to how typescripts tsc --noEmit validates types without actually building them.
I think that feature by itself would be useful, but more specifically for vercel's ignore build step feature this would be extremely useful
Describe the solution you'd like
So if I wanted to fill out the Ignore Build Step field in a vercel build I'd like to be able to do something like this:
turbo --scope="my-app" --include-dependencies --noEmit --quite

where --noEmit says don't build anything just tell me if anything is invalidated
and --quite removes any output and exits with a 0 if there are invalidated packages
(these could of course be wrapped up together into their own flag as well)
The end result being only starting a build pipeline if the targeted package has changed or any of its upstream dependencies have changed.
Describe alternatives you've considered
I could get around this currently by adding a npm script like this to each package.json:
{
  "cached": ":"
}

and then this to my turbo config
{
      "cached": {
        "dependsOn": [
          "^cached"
        ]
      },
}

and then parse the output of turbo run cached --scope="my-app" --include-dependencies to determine if I should exit with 0 or not, but that all seems like a cumbersome way to do this.

There's a --dry and --dry=json flag now that does this!


VueDisqus, Building using latest VueCLI and Internet Explorer 11

There may be a bug with the vue-disqus plugin.  On my system it errors out around this line in IE 11.  Any suggestions?  Awesome plugin btw!
mounted () {       if (window.DISQUS) {

So I think VueCli by default does not transpile node modules.  Therefore Internet Explorer 11 cannot understand this shorthand syntax.  I have not yet figured out a way to resolve this yet.  If I add VueDisqus to the transpileDependencies list it does not seem to work.  I need to learn more about how this works.  Let me know if anyone else who has had this issue has any suggestions.

@mjruschak Is your issue resolved yet? Do you have the error message the Internet Explorer produced arong that line of code? And can you share some details about how did you configure VueCli?

That is correct I did have an error message along that line of code.  "Expected :"
I believe the plugin would need to be updated to support Babel 7 but I am not a Babel expert so not entirely sure.  VueCli is configured to use Babel for my project.  VueCli uses Babel 7 which uses the new babel-config.js format.  I have reason to believe this is why transpileDependencies for the vue config is not working right for this plugin.  There are a lot of plugins out there that support older versions of Babel still.  I found out this was not the only Vue plugin having the problem.  I only had one Vue plugin work correctly.
I believe Babel should Transpile the line with the error to be like this
mounted: function()
Anyways I ultimately decided not to support IE 11.  I have just had it with that browser and most of the customers using the web site we upgraded to use Vue do not use it anyway.  Only had a few support requests and we just tell them to use a different browser.
If I wanted to fix it I could probably pull the .vue file from node_modules into the application directory.  This way Babel would likely transpile it correctly.
Otherwise this plugin may need to be updated to support the new Babel version but again I want to reiterate I do not know that for sure.  Not a Babel expert.

Run a test using import VueDisqus from 'vue-disqus/dist/vue-disqus.vue'

When I do that it says I did not register the component correctly.

Also your solution helped me fix a few other plugins by importing from dist.  Just does not work for VueDisqus.  I should point out that even if it did import the syntax is still not going to work in IE 11.  It needs to be run through Babel somehow...

vue-disqus will go through a refactory and I will correct these problems, as soon as I have a new version, I hereby communicate you here.

Hello, the ":identifier" does not work.I am tring render the same component with different routers
console_log

@mjruschak
VueDisqus v4, can you check if the error persist?


AnalyzeAPK: memory leaking

There will be a problem when I use AnalyzeAPK mudule to annlyze apk in a multi-process environment. At first, I thought the reason is my local code, but after a long test, I found that it was a problem with the AnalyzeAPK module.
So I hope that somebody can test this problem, and fix it if this problem really exists.
Thank you, excuse my poor English.
System Information

Androguard Version: master
Python Version: 3.6/...
Operating System

There will be a problem when I use AnalyzeAPK mudule to annlyze apk in a multi-process environment. At first, I thought the reason is my local code, but after a long test, I found that it was a problem with the AnalyzeAPK module.

Can you explain what kind of problem?
I assume the python process uses up a lot of RAM (judging from the title)... I had this issue before and after investigating in it, I can tell you that this is not a memory leak but due to memory fragmentation of the python process itself. But if you are using multiprocessing, just use subprocesses. If your analysis function has finished, all the memory will be freed. Unfortunately, there is no other way, as python is designed that way (at least there is no other way I know about).

Maybe related: #403
There might be some tweaks to reduce the footprint by a few MB, but I fear this is all what is possible.

@reox
I am sorry for late reply and thank for your answer.
I am sure that the problem of memory growth is caused by AnalyzeAPK module. I have tested two scenarios, one using AnalyzeAPK module, and one not. The first one occurs memory growth, and the second will keep memory stable.
The version of androguard 3.0 performs well, even if I use multiprocessing. But version of androguard 3.1 will keep memory growth, it will fill my 126G memory, and will not stop until I kill it.
And I will try your suggestion about using subprocesses.
Thank you for your reply, please tell me if my problem description confused you.

Oh wow, you have a lot of memory!
Do you use a Session? Can you test to reset the session after every call to AnalyzeAPK? Like CONF["SESSSION"].reset()
Otherwise, can you monitor what is going on using some python memory profiling tools? Like pympler or other tools.. you can probably use the tools mentioned here: https://stackoverflow.com/questions/1435415/python-memory-leaks

The large memory machine is a server in my lab, LOL.
I have tried your suggestion about CONF['SESSION'].reset(), it works. Now It almost cost  6G memory when I use 26 processes. Amazing, but in fact I don't know why, can you explain it to me if you have time?
Thank you very much, have a good time.

okay, then I understand what the problem is - you are actually not memory leaking, but storing all old analysis.
The Session is used for exactly this purpose: be able to add several APKs / DEX files, then work with them, save the session to disk, load it again and so on.
If you are doing some automated analysis, you probably do not want this behaviour - as you are not interested in keeping old stuff, you already have analysed or maybe even stored in some other format (at least I do such stuff).
If you set the session parameter in AnalayseAPK to None, the Default session is used - as I fixed that recently, you will actually always get the same session, thus add more and more APKs to it.
What I can, and will do, is to change the behaviour of AnalyzeAPK and AnalyzeDEX to use no session at all, if session=None.

Oh, I see.
I see that it will get default seesion if the session parameter is None. So the default session will store all apk's analysis, but how can I use no session?
And will the session clear itself automatically if I don't use default session but changed session with apk?
Thank you.

OK, thank you very much.


jsk_common: 2.2.15-4 in 'noetic/distribution.yaml' [bloom]

Increasing version of package(s) in repository jsk_common to 2.2.15-4:

upstream repository: https://github.com/jsk-ros-pkg/jsk_common
release repository: https://github.com/tork-a/jsk_common-release.git
distro file: noetic/distribution.yaml
bloom version: 0.11.2
previous version for package: 2.2.15-2

audio_video_recorder

No changes

dynamic_tf_publisher

No changes

image_view2

No changes

jsk_common

No changes

jsk_data
* [jsk_data] Automatically add the host key and Check stdout.read() type (#1810 <https://github.com/jsk-ros-pkg/jsk_common/issues/1810>)
  - stdout.read() returns a bytes object in Python 3, whereas in Python 2, it returned a str
  - The error indicates that the new version of Paramiko (2.6.0) is stricter about host key checking, requiring the server to be present in the known_hosts file by default. This is a security feature to prevent man-in-the-middle attacks.
* Contributors: Kei Okada

jsk_network_tools

No changes

jsk_rosbag_tools

No changes

jsk_tilt_laser

No changes

jsk_tools

No changes

jsk_topic_tools

No changes

multi_map_server

No changes

virtual_force_publisher

No changes

@marcoag thanks for review, Currently jsk_common fails on armhf, and should be resolved by this patch. So I think we should merge this before next notic sync.
https://build.ros.org/view/Nbin_ufhf_uFhf/job/Nsrc_uF__jsk_rosbag_tools__ubuntu_focal__source/

@k-okada thanks for the info. I will defer to @sloretz as the noetic boss for that decision.

Thank you @sloretz @marcoag
Fixed armhf build
https://build.ros.org/view/Nbin_ufhf_uFhf/job/Nbin_ufhf_uFhf__jsk_rosbag_tools__ubuntu_focal_armhf__binary/


[INLONG-1834] Access support pulsar

Title Name: [INLONG-XYZ][component] Title of the pull request
where XYZ should be replaced by the actual issue number.
Fixes #1834
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change

[ ] Make sure that the change passes the CI checks.

(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)

Added integration tests for end-to-end deployment with large payloads (10MB)
Extended integration test for recovery after broker failure

Documentation

Does this pull request introduce a new feature? (yes / no)
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
If a feature is not applicable for documentation, explain why?
If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

Codecov Report

Merging #1843 (d90ce38) into master (14fb846) will decrease coverage by 0.44%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1843      +/-   ##
============================================
- Coverage     11.96%   11.52%   -0.45%
+ Complexity     1048     1046       -2
============================================
  Files           399      400       +1
  Lines         33466    34789    +1323
  Branches       5276     5504     +228
============================================
+ Hits           4003     4008       +5
- Misses        28695    30016    +1321
+ Partials        768      765       -3

Impacted Files
Coverage Δ

...he/inlong/tubemq/client/consumer/RmtDataCache.java
24.16% <0.00%> (-13.18%)
:arrow_down:

...inlong/tubemq/manager/service/TaskServiceImpl.java
3.65% <0.00%> (-4.88%)
:arrow_down:

.../tubemq/client/factory/TubeBaseSessionFactory.java
53.76% <0.00%> (-4.38%)
:arrow_down:

...tubemq/client/factory/TubeMultiSessionFactory.java
39.28% <0.00%> (-3.03%)
:arrow_down:

...ong/tubemq/manager/service/ClusterServiceImpl.java
50.00% <0.00%> (-2.95%)
:arrow_down:

...e/inlong/tubemq/client/consumer/ClientSubInfo.java
14.47% <0.00%> (-2.20%)
:arrow_down:

...bemq/server/common/heartbeat/HeartbeatManager.java
36.36% <0.00%> (-2.03%)
:arrow_down:

...ubemq/client/factory/TubeSingleSessionFactory.java
32.50% <0.00%> (-1.72%)
:arrow_down:

...ng/tubemq/client/consumer/BaseMessageConsumer.java
6.25% <0.00%> (-0.09%)
:arrow_down:

...q/client/consumer/SimpleClientBalanceConsumer.java
0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14fb846...d90ce38. Read the comment docs.