fix: runpy.run_path(path) crashes with pathlib.Path

I ran into the following problem where coverage replaces runpy.run_path() in a way that does not accept Path objects:
import runpy

script = "print('hello, world!')\n"

def test_path(tmp_path):
    pyfile = tmp_path / 'script.py'
    pyfile.write_text(script)
    runpy.run_path(pyfile)

This passes with ordinary pytest but crashes with pytest --cov with the following traceback:
Traceback (most recent call last):
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/_pytest/runner.py", line 341, in from_call
    result: Optional[TResult] = func()
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 146, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_callers.py", line 182, in _multicall
    return outcome.get_result()
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
    raise e
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
    item.runtest()
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/home/askhl/install/pyenv/lib/python3.10/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "/home/askhl/coverage-runpy/test.py", line 11, in test_path
    runpy.run_path(pyfile)
  File "/usr/lib/python3.10/runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/askhl/src/coveragepy/coverage/control.py", line 395, in _should_trace
    disp = self._inorout.should_trace(filename, frame)
  File "/home/askhl/src/coveragepy/coverage/inorout.py", line 324, in should_trace
    filename = source_for_file(dunder_file)
  File "/home/askhl/src/coveragepy/coverage/python.py", line 107, in source_for_file
    if filename.endswith(".py"):
AttributeError: 'PosixPath' object has no attribute 'endswith'

This PR contains a minimal fix which sends the input through str(Path(...)).  However a proper fix might require some awareness of the surrounding code as well as a test, so I'd expect the PR in its current form to be insufficient.  Feedback would be appreciated.

Thanks @nedbat!
It crossed my mind that it could originate with pytest or pytest-cov, since there's something finicky going on between runpy and the code object that could originate from some out-of-sight hook.  I reproduced it now with only coverage run:
import runpy
from pathlib import Path

script = "print('hello, world!')\n"
pyfile = Path('script.py')
pyfile.write_text(script)
runpy.run_path(pyfile)

This yields the considerably shorter stacktrace
(pyenv) askhl@alberich:~/coverage-runpy$ coverage run test.py
Traceback (most recent call last):
  File "/home/askhl/coverage-runpy/test.py", line 8, in <module>
    runpy.run_path(pyfile)
  File "/usr/lib/python3.10/runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/askhl/src/coveragepy/coverage/control.py", line 395, in _should_trace
    disp = self._inorout.should_trace(filename, frame)
  File "/home/askhl/src/coveragepy/coverage/inorout.py", line 324, in should_trace
    filename = source_for_file(dunder_file)
  File "/home/askhl/src/coveragepy/coverage/python.py", line 107, in source_for_file
    if filename.endswith(".py"):
AttributeError: 'PosixPath' object has no attribute 'endswith'

After some messing around I found that usually the function receives a str, but it receives a Path('script.py') when it does             dunder_file = frame.f_globals and frame.f_globals.get("__file__").
I pushed a change inserting a conversion there instead of in the previous place.
So that fix will equally well solve the problem without the need to think about Path|str in multiple places, and hence is a more credible fix.
But I don't know if there's any documentation that could reveal what types frame.f_globals.get('__file__') should have.

It crossed my mind that it could originate with pytest or pytest-cov

No worries, when a bug report mentions pytest-cov, the first thing I do is try to reproduce it without it. I also saw it with just coverage run.
I like the latest change: it feels like the right place.
Do you want to add yourself to CONTRIBUTORS and add a changelog entry? I can take care of it if you like.

I have added a test in what I perceive to be a reasonably correct place.

Do you want to add yourself to CONTRIBUTORS and add a changelog entry? I can take care of it if you like.

Thanks.  Since the list of unreleased changes is empty, I was not sure whether to add a note before or after .. scriv-start-here, or whether that's necessarily the correct place.  Please make any changes you think appropriate.

I just pushed a lint-fixing change but you have apparently already done something about it.  Feel free to ignore/adapt/close this.
I am not sure whether this should actually be considered an issue with runpy.  The docs (https://docs.python.org/3/reference/import.html#file__) say rather clearly that __file__ should be str if it exists.
Thanks a lot!

I also beefed up the test a bit in https://github.com/askhl/coveragepy/pull/1.  You can merge that pull request to get my changes.

I also beefed up the test a bit in https://github.com/askhl/coveragepy/pull/1. You can merge that pull request to get my changes.

Nice.  It's merged.

Thanks!

This is now released as part of coverage 7.6.1.


Show trailing whitespace only mode

It would be great to have a mode that would only show trailing whitespace, or whitespace on a line with no text.

I like it. I wonder what would be the best way to change render modes. Could look into a command with parameters, or some kind of configuration for a persistent change.

A config would be nice to set the default possibly, and then have commands something like this:
Whitespace+ Enable Trailing
Whitespace+ Enable All
Whitespace+ Disable

I'm sorry about the huge delay (life, work, etc..), but the latest update overhauls the extension and adds a trailing whitespace mode, as well as the ability for custom patterns or decorators, if you would still find it handy. Check the readme for more details.
#2

@davidhouchin No issues. The update looks really good.
I loaded it up, explored the functionality a bit, switched it to "trailing" mode and then adjusted the trailing config to look like this:
{
        "name": "trailing",
        "enabled": false,
        "pattern": "[^\\S\\r\\n]+$",
        "style": {
            "borderWidth": "1px",
            "borderRadius": "2px",
            "borderStyle": "solid",
            "light": {
                "backgroundColor": "rgba(255, 0, 0, 0.3)",
                "borderColor": "rgba(169, 169, 169, 0.4)"
            },
            "dark": {
                "backgroundColor": "rgba(255, 0, 0, 0.3)",
                "borderColor": "rgba(169, 169, 169, 0.4)"
            }
        }
    }

and viola, all is good.
Thank you very much for getting this in. It is much appreciated!


Form component errors message update after changing the language.

Description
I encountered an issue that when I switch languages using i18n, the error message is not re-rendered correctly in the new language. I tried listening to the language change event and used the ref form.value.validate to update the error message, but it triggers validation for all fields and and unable to update the error message for more than 1 specific input field.

Additional context
No response

Would you mind sharing a reproduction? Not sure to understand why triggering validation for all fields is a bad thing?

hi @benjamincanac, Activating validation for all fields is okay, but if we revalidate for more than one specific field, it will offer more choices for developer and align with users that prefer that kind of experience.
https://github.com/nuxt/ui/assets/50744056/42f46d7b-b89f-4c0c-aa50-a4faee9e3c16

hi @benjamincanac, Activating validation for all fields is okay, but if we revalidate for more than one specific field, it will offer more choices for developer and align with users that prefer that kind of experience.
https://github.com/nuxt/ui/assets/50744056/4ef6817d-2045-4b66-894c-4120e39464b1

@romhml Can you help me, please?

@benjamincanac @romhml Could you give me some suggestions to solve this issue?

@sangbk208 I'd suggest to either clear the validation errors when the language is updated or to manually update errors, here is an example function you can use:
const form = ref<Form<Schema>>();

async function updateFormErrors() {
  // Solution 1: Clear all errors
  // form.value?.clear();

  // Solution 2: Manually update errors
  const activeErrorPath = form.value.errors.map((e) => e.path);

  await form.value?.validate(undefined, { silent: true });
  form.value.setErrors(
    form.value.errors.filter((e) => activeErrorPath.includes(e.path)),
  );
}

It's a bit hacky but it should solve your issue. I'll look into implementing this function in the Form's API to simplify this later on.

@romhml Thank you so much, I have resolved my issue.


Bootstrap Demo Adding an Additional remove Icon When Using IE11

There is an issue with the Bootstrap demo adding an additional remove icon on focus when using IE11. See screenshot -

I think it's the clear button added by >IE10 to the fields. This button clears away the current value of the input element. And only shown on focused non empty input text elements.
For references:

https://developer.mozilla.org/en-US/docs/Web/CSS/::-ms-clear
https://support.microsoft.com/en-us/kb/2813492
http://stackoverflow.com/questions/13481577/how-can-i-disable-the-clear-button-that-ie10-inserts-into-textboxes
http://stackoverflow.com/questions/14007655/remove-ie10s-clear-field-x-button-on-certain-inputs

I will close the issue, feel free to discuss it further.

Thanks for the quick responce.  Argh! Microsoft are so good at getting it wrong. By the way, the fix suggested via the first Stack Overflow link worked :)


Display ignored checks

Is your feature request related to a problem? Please describe.
When I ignore certain checks I would like to run command that would show me all the ignored checks.
Describe the solution you'd like
New flag to collect ignored checks and display them.

You could probably add a debug line here https://github.com/tfsec/tfsec/blob/f0603d3df38c4128e834f82bdbd6468010021b72/internal/app/tfsec/scanner/scanner.go#L96 and then when you want to see it you can run --verbose
If that is the way you go, maybe reduce the checkRangeIngored function to have a single return point and do the debug.Log(....) at if the result is true?


Generalize Navigationcontainers

Hi Daniel,
currently the InitCall only accepts a Navigationpage which is a Limitation if an App should have a MasterDetail or TabbedPage as Rootelement.
Also it's not clear how to create and Push ContainerPages higher up the Navigation Stack.
Also we need a consistend way how to init these Containers with their child elements. One way could be to provide default ViewModels that have child properties/Collections that you have to register first, but that's a problem in the way that we currently only push ViewModelTypes.
A look at the features of FreshMVVM may help as inspriation ;-) https://github.com/rid00z/FreshMvvm#multiple-navigation-services
E.g. the possibility to switch out the whole Navigationstack is pretty need.
Ways to solve this

Use static registration with Lazy creation methods for the viewmodel
Allow to provide ViewModel Instances when pushing Pages
Having additional InitMethods/PushMethods that allow to provide Child viewModelTypes

What do you think
Best
Thomas
P.S.: You may say, why don't you just use FreshMVVM? The reason is that PageFactory is even lighter and as such ideal to combine with RxUI. Also  as comfortable all the IoC and convention basing is it eats up to many resources especially at app startup.

Upcoming release will be a major one, so it's a good occasion to do some API changes / refactorings. Some my thoughts:

Change PageFactory Init method, to contain any IBasePage object
Remove existing navigation methods and replace them with IBasePage extensions. Internal methods will use Page Navigation properties as a navigation.
Add page cache keys support, eg: GetPageFromCache<TViewModel>("someKey")
Add page cache auto-removal after a certain duration.

+1 for:

Use static registration with Lazy creation methods for the viewmodel
Allow to provide ViewModel Instances when pushing Pages
Having additional InitMethods/PushMethods that allow to provide Child viewModelTypes

P.S.: You may say, why don't you just use FreshMVVM? The reason is that PageFactory is even lighter and as such ideal to combine with RxUI. Also as comfortable all the IoC and convention basing is it eats up to many resources especially at app startup.

I'm not worried to do some changes / modifications / improvements, especially if want to collaborate on this. Performance is also very important to me.

Yes, I really like to contribute as I need a solid foundation for my next projects.
If you tell me what I can do I'm happy to help

That's great. At first, we could think of API rewrites and features which should be implemented. Do you have any ideas?

I think one important decission will be if we keep the automatic
Assembly discovery or switch to manual?
Manual registration has also the advantage that I can switchout the
PageClass e.g. for bigger screens on the other side it's additional
work.
------ Originalnachricht ------
Von: "Daniel Luberda"<EMAIL_ADDRESS>An: "daniel-luberda/DLToolkit.PageFactory"
<EMAIL_ADDRESS>Cc: "escamoteur"<EMAIL_ADDRESS>"Author"
<EMAIL_ADDRESS>Gesendet: 02.10.2016 16:23:09
Betreff: Re: [daniel-luberda/DLToolkit.PageFactory] Generalize
Navigationcontainers (#11)

That's great. At first, we could think of API rewrites and features
which should be implemented. Do you have any ideas?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


[HPVC] Synergy Chassis Virtual Switch

Device Vendor: HP
Device Model: Synergy Virtual Switch
System Object Identifier (SysOID): <IP_ADDRESS>.<IP_ADDRESS>.7.5.9
List of critical metrics that you expect in the profile (does not need to be all-inclusive, just a general idea of your expectations):

CPU/Mem/Bandwidth
Hardware health
IF Errors

Please provide a public gist with a sanitized (sensitive information removed) SNMP walk of the device. Providing MIB files is not a substitute for an SNMP walk and failure to provide one here will result in delays for closing this issue. The output of these commands shows the "true story" of what a device will respond to in SNMP and is used to ensure that our profiles are efficient and accurate for your devices.
Gist Link:

Example SNMP walk commands:
# v2c example
snmpwalk -v 2c -t 10 -On -c $COMMUNITY_STRING $IP_ADDRESS . >> snmp_walk.out

# v3 example
snmpwalk -v3 -t 10 -l authPriv -u $USERNAME -a MD5|SHA -A $AUTH_PASS -x DES|AES -X $PRIV_PASS -ObentU -Cc $IP_ADDRESS . >> snmp_walk.out

Please find the attached SNMP WALK output.
RNPSYN102-SNMPWALK.txt

@viramamur
I went digging around and was unable to find anywhere with the MIB published for the majority of the OID's in your walk.  In cases like this the vendor will sometimes provide a copy of the MIB file locally on the appliance or through their support portal.  Given that none of the normal sources seems to have it for this device I will need you to provide it from HP so we can build a profile for these device class.


The cost computation of doing a roll on the top of the sheet is wrong

It appears to drop the current EP to the base level, in the cases where it should be higher.

Looking at this now...

Probably the same issue as #79

Fixed in #81


App not downloading via flipper lab

every time I try to install the fmf_to_sub-ghz app it says:
Error: Failed to fetch application build (1008)
please fix the error

there is no .fap file

I'm not seeing any error.  What firmware are you on?
Step 1. https://lab.flipper.net/apps/fmf_to_sub
Step 2. Click "Install" button
Step 3. On Flipper open "Apps / Sub-GHz/ Music to Sub-GHz Radio"
Application loads without any error - shows "Configure / Convert / About" screen.


Forecasting: Initial letter should be capitalized, and the full stop is missing for the description of metric "MAPE".

System Information (please complete the following information):
Windows OS: Windows-11-Enterprise-21H2
ML.Net Model Builder 2022: <IP_ADDRESS>5702 (Main Build)
Microsoft Visual Studio Enterprise: 2022(17.3.6)
.Net: 6.0
Describe the bug

On which step of the process did you run into an issue:
Initial letter should be capitalized, and the full stop is missing for the description of metric "MAPE".

Data Source
https://testpass.blob.core.windows.net/test-pass-data/forecasting.csv
To Reproduce
Steps to reproduce the behavior:

Select Create a new project from the Visual Studio 2022 start window.
Choose the C# Console App (.NET Core6.0) project template.
Add model builder by right click on the project.
Select Forecasting scenario.
On Data page, select the data source and choose "sinx" column as label.
On the Train page, click "Advanced training options..." link.
Then you will see that initial letter lowercase, and the full stop is missing for the description of metric "MAPE".

Expected behavior
Initial letter should be capitalized, and the full stop is missing for the description of metric "MAPE".
Screenshot

The bug has been fixed on the latest main build <IP_ADDRESS>1501


Rename lastActionCreated to lastVisibleActionCreated in App

Details
Renames lastActionCreated to lastVisibleActionCreated.
Fixed Issues
https://github.com/Expensify/Expensify/issues/251662 (partial)
Tests
There are quite a few automated tests covering this already, but we should still test the core flows:
Should be tested with https://github.com/Expensify/Web-Expensify/pull/36396

Log into the App
Verify that the LHN chats get ordered by the most recent message date (if they are not pinned, don't have an outstanding IOU or draft message, etc)
Open a chat and verify that you can see the message date
Verify that you can send, edit and delete messages
Open the search RHN
Verify that the options are sorted by the most recent messages
Open a chat with several messages
Verify that you can mark messages as unread and that the unread message indicator shows up
Verify that you can send a money request + > Request money

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

Offline tests

Go offline
Verify that you can create a chat with a new participant
Send a message
Verify that you see the message timestamp
Go online
Verify that the chat is successfully created and the message is sent (they are no longer greyed out)

QA Steps
Regression tests + steps in test and offline sections

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

Screenshots/Videos

Web
https://user-images.githubusercontent.com/22219519/217333296-6761203f-7d19-45ca-b051-b03c49c01199.mov

Mobile Web - Chrome
https://user-images.githubusercontent.com/22219519/217333312-cd4840da-6dfd-4edb-8ab0-8e6bbfe9fb21.mov

Mobile Web - Safari
https://user-images.githubusercontent.com/22219519/217333324-b463f462-7217-49c4-a711-38eeec4b0f2e.mov

Desktop
https://user-images.githubusercontent.com/22219519/217333335-4a103a33-0cb1-4bb2-9c0c-6417b4e6d91d.mov

iOS
https://user-images.githubusercontent.com/22219519/217333351-c2ccc7d1-9d2e-493d-a489-e46007454ef3.mov

Android
https://user-images.githubusercontent.com/22219519/217337364-20fccb9e-b8d2-43b3-a9fe-b201136b5011.mov

@marcaaron Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

Web-E is merged. This is off hold.

Updated!

Reviewer Checklist

[ ] 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 included screenshots or videos for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] Android / native
[ ] Android / Chrome
[ ] iOS / native
[ ] iOS / Safari
[ ] MacOS / Chrome / Safari
[ ] 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 is localized by adding it to src/languages/* files and using the translation method
[ ] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[ ] 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.
[ ] 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 */
[ ] 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 any new file was added I verified that:

[ ] 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

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

Screenshots/Videos

Web

Mobile Web - Chrome

Mobile Web - Safari

Desktop

iOS

Android

Verify that the LHN chats get ordered by the most recent message date (if they are not pinned, don't have an outstanding IOU or draft message, etc)

NAB, could we make these test steps more explicit?  e.g. if we are starting with a chat in a certain state - let's give the steps to get it in that state. if we want testers to verify whether the pinned, draft, IOU stuff still works then should we have steps asking people to do those things. Not sure if everyone feels this way though.

LGTM but some unit test is failing. Restarting it...

Something is still failing

Updated test steps and fixed failing tests! Ready for another review!

: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/marcaaron in version: 1.2.74-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/chiragsalian in version: 1.2.74-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


Regression: Multiple projects linked by npm link do not compile properly within vscode

TypeScript Version:  2.0.6, 2.0.7 and 2.1.0-dev.20161107
VSCode Version:  1.7.1
OS Version:  Debian GNU/Linux 8.6
This is a regression of  #9585. The original problem was fixed in TypeScript 2.0.2 but since 2.0.6 the problem is back. Here is a copy of the reproduction instructions which are still correct (But I haven't made a new screenshot because it would just show the same error with a different TypeScript version):
Steps to reproduce:

Globally install TypeScript (Current is 2.0.7) with "npm install -g typescript"

Install latest vscode (Current is 1.7.1)

Configure vscode to use the globally installed TypeScript by setting the typescript.tsdk path in the user settings.

Unpack the projects.zip
archive somewhere.

Run npm link in projects/base.

Run npm link base in projects/ui.

Run npm link in projects/ui.

Run npm link base in projects/application.

Run npm link ui in projects/application.

Run tsc in projects/application and notice that it compiles correctly.

Now open projects/application in vscode and open the file src/main/Impl.ts. The following error is displayed:
Class 'TestImpl' incorrectly implements interface 'Test'.
  Types of property 'getPoint' are incompatible.
    Type '() => Point' is not assignable to type '() => Point'.
      Type 'Point' is not assignable to type 'Point'.
        Types have separate declarations of a private property 'x'.

Press Ctrl-Shift-B to compile the project with the command line compiler. The error disappears.

Edit the file (inserting a whitespace for example) and the error re-appears.

So while the project compiles fine on the command line (Running tsc directly) it doesn't compile within vscode which uses the exact same compiler.
Here is a screenshot of the error message:

@andy-ms can you take a look.

@kayahr, just to be sure, could you test this out on your computer with tomorrow's build?

Yes, it works with 2.1.0-dev.20161108. In 2.0.8 it is still broken. Will this fix be merged into the release branch so it will land in 2.0.9?

The fix will be in the final release of TypeScript 2.1

No chance to get this fix in 2.0? It was fixed before for 2.0.2 and now its broken again which means we are stuck at 2.0.2 until 2.1 is released.


[SUGGESTION] join/leave

Hello,
It's possible to add join /leave messages in game chat for players ?
It's good to keep track of who's joining and leaving .
Also to send messages from discord to ingame chat world be great, and pre defined messages to be send every set time , like sending discord link every 1h, stuff like that .
And thanks for making this

@ShadyGame Actually, for join/leave message, there is another repo that uses Discord to keep track: https://github.com/steezeburger/palguybuddydude. I've also deployed this one and connected with another channel in Discord.
Maybe, @KOOKIIEStudios you may also consider combining this repo into our dependencies if that is allowed.

@ShadyGame Actually, for join/leave message, there is another repo that uses Discord to keep track: https://github.com/steezeburger/palguybuddydude. I've also deployed this one and connected with another channel in Discord.
Maybe, @KOOKIIEStudios you may also consider combining this repo into our dependencies if that is allowed.

It's copyrighted actually. Not open source. I think.
But it's a common enough way of doing things so it shouldn't be too big of a problem.

I'll give it a try. Thanks

@ShadyGame Actually, for join/leave message, there is another repo that uses Discord to keep track: https://github.com/steezeburger/palguybuddydude. I've also deployed this one and connected with another channel in Discord.
Maybe, @KOOKIIEStudios you may also consider combining this repo into our dependencies if that is allowed.

im such a noob i dont know how to run that thing.
docker-compose up -d , nothing happens. i know its not related here sorry

They're dockerized. You'd need to first set up docker and docker compose. Our project isn't virtualized using docker, so forgive me but I'm not particularly inclined to provide support for someone else's project.


Python and MongoDB basics

Please fill in this pull request template before submitting
1. This pull request resolves #55
2. Description
Created a directory databases with sub directory mongodb for tutorials on "MongoDB database using Python3". There exists 2 files for basics knowledge of how "Pymongo" module is used to work with MongoDB using Python3.
3. Fill in checklist by marking [x]

[x] I've read the CONTRIBUTING.md
[x] I was assigned to this issue
[x] My code is formatted using required linting
[x] I've run my code locally and checked it works

How can I install modules at here even I added how to install module but at here in github how to do module installation please help me out @funbeedev

@harshmangal1108 You can ignore the executable error here on github since your file is dependent on installing modules.
I installed the requirements locally and I tried running the file pymongo_basic.py but I get the following error. What needs to be done to resolve?
MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True)
Traceback (most recent call last):
  File "databases/mongodb/pymongo_basic.py", line 18, in <module>
    print("Available Databases", client.list_database_names())
  File "/home/funmbi/.local/lib/python3.8/site-packages/pymongo/database.py", line 1135, in __call__
    raise TypeError("'Database' object is not callable. If you meant to "
TypeError: 'Database' object is not callable. If you meant to call the 'list_database_names' method on a 'MongoClient' object it is failing because no such method exists.

@harshmangal1108 You can ignore the executable error here on github since your file is dependent on installing modules.
I installed the requirements locally and I tried running the file pymongo_basic.py but I get the following error. What needs to be done to resolve?
MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True)
Traceback (most recent call last):
  File "databases/mongodb/pymongo_basic.py", line 18, in <module>
    print("Available Databases", client.list_database_names())
  File "/home/user/.local/lib/python3.8/site-packages/pymongo/database.py", line 1135, in __call__
    raise TypeError("'Database' object is not callable. If you meant to "
TypeError: 'Database' object is not callable. If you meant to call the 'list_database_names' method on a 'MongoClient' object it is failing because no such method exists.

Actually this is based on version of Pymongo Module we are trying with "3.5.1" but it actually works fine with "2.8" version.I am updating it in requirements.txt as well you can check by installing with "pip install pymongo==2.8".
Hope that helps.

@harshmangal1108
I installed pymongo 2.8 but now im getting the below error. Is there any other setup or configuration requirements? The tutorial should contain everything needed to execute the code. Please update, thanks.
Traceback (most recent call last):
  File "TeachMePythonLikeIm5/databases/mongodb/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 374, in __init__
    self._ensure_connected(True)
  File "TeachMePythonLikeIm5/databases/mongodb/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 939, in _ensure_connected
    self.__ensure_member()
  File "TeachMePythonLikeIm5/databases/mongodb/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 813, in __ensure_member
    member, nodes = self.__find_node()
  File "TeachMePythonLikeIm5/databases/mongodb/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 904, in __find_node
    raise AutoReconnect(', '.join(errors))
pymongo.errors.AutoReconnect: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pymongo_basic.py", line 15, in <module>
    client = MongoClient()
  File "TeachMePythonLikeIm5/databases/mongodb/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 377, in __init__
    raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: [Errno 111] Connection refused

I think then now you have to troubleshoot MongoDB in your system and make sure mongoDB in that system is running fine. You can check following things that might help:

Removing mongod.lock inside /var/lib/mongodb
sudo rm /var/lib/mongodb/mongod.lock
Restarting the mongodb service (according to your system below command is for linux)
systemctl restart mongod.service

Is there anything else? If not then please do merge this one @funbeedev

Is there anything else? If not then please do merge this one @funbeedev

@harshmangal1108 Apologies, should have got back to you sooner on this!
I'm still not able to run either of the python files.
You mentioned I need to troubleshoot mongodb on my system. I assume this means I need some extra applications installed on my system other than the ones listed in the README and requirements.txt? If so could you please list out all requirements needed to run the python tutorials. Assume the machine is clean and the user doesn't know where to start.
I'm not familiar at all with mongodb so I'm using your tutorial to learn it myself! I've now installed mongodb on my PC using sudo apt-get install mongodb as I didn't realise initially it was a service that needed to run on the PC. I've also run the commands you listed including trying various other commands. mongodb appears to be running on my PC now but I still get the following error when running pymongo_basic.py:
MongoClient('localhost', 27017)
Traceback (most recent call last):
  File "pymongo_basic.py", line 18, in <module>
    print("Available Databases", client.list_database_names())
  File "/home/user/.local/lib/python3.8/site-packages/pymongo/database.py", line 1047, in __call__
    raise TypeError("'Database' object is not callable. If you meant to "
TypeError: 'Database' object is not callable. If you meant to call the 'list_database_names' method on a 'MongoClient' object it is failing because no such method exists.

I can spend a bit more time trying to get the file to run but I want to ask you first in case there's something obvious I'm missing :)
Tutorials should work out of the box or detail all dependencies needed so that someone new to the topic can get it running. That's why I haven't merged it yet.
Would appreciate if you could update the docs with any additional requirements needed to run the python files. Also some basic explanation into what mongodb is used for would be good :)
Thanks!

@harshmangal1108  Any chance you could still update this PR? 😅

Yeah sure! will check this once again.