Problem in sync between arduino and the sensel device

Hi,
I am using the default application of this github library, and I have some issues in having a continuous output on the serial monitor of arduino. It seems like the board prints out x-coordinate, y-coordinate and the force values when I press the board yet but then it prints a bunch of blank lines before printing another line of valid x,y coordinates and the force... sample of the output shown below:
⸮&�Num Contacts: 1 Contact 0: x_pos 167.05 y_pos 72.72 total_force 781.50 ⸮&� ⸮&� ⸮&� ⸮&� ⸮&�Num Contacts: 1 Contact 0: x_pos 166.59 y_pos 72.88 total_force 765.63 ⸮&�Num Contacts: 1 Contact 0: x_pos 166.56 y_pos 72.90 total_force 764.75 ⸮&� ⸮&� ⸮&� ⸮&� ⸮&�Num Contacts: 1 Contact 0: x_pos 166.41 y_pos 72.92 total_force 700.00 ⸮&� ⸮&� ⸮&� ⸮&�Num Contacts: 1 Contact 0: x_pos 166.34 y_pos 73.04 total_force 661.88 ⸮&�Num Contacts: 1 Contact 0: x_pos 166.38 y_pos 73.10 total_force 670.38 ⸮&� ⸮&� ⸮&� ⸮&� ⸮&�Num Contacts: 1 Contact 0: x_pos 166.43 y_pos 73.25 total_force 670.25 ⸮&�
Now I am not sure why I am getting the blank slots in the middle but it makes me think one of the two devices is running slower than the other. Could someone help me debug this issue?
Thanks

Hello and thank you for contacting us. To help us debug, what chip or board are you using? We had issues with Software Serial or shared with USB so we recommend a dedicated Hardware Serial. If you are using a hardware serial, we are happy to look into the issue further.

Hardware serial (replacing arduino uno with a mega basically) did the job! Thank you, your answer helped!


Combined dcover create --preflight --fixbuild

Replaced dcover create --preflight ; dcover fix-build with a single dcover create --preflight --fix-build

Diffblue Cover

Run: Test: Maven Project / Test  (ubuntu-latest)
Commit: aa60cdb34112350d304f0913c4e2cf7da45f79c9

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: aa60cdb34112350d304f0913c4e2cf7da45f79c9

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: aa60cdb34112350d304f0913c4e2cf7da45f79c9

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: aa60cdb34112350d304f0913c4e2cf7da45f79c9

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (ubuntu-latest)
Commit: e3dc755fe7f11945fd352a4ee60609eee36ce535

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: e3dc755fe7f11945fd352a4ee60609eee36ce535

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: e3dc755fe7f11945fd352a4ee60609eee36ce535

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: e3dc755fe7f11945fd352a4ee60609eee36ce535

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: e3dc755fe7f11945fd352a4ee60609eee36ce535

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: b85ded41b5302a22f4abc23514c2a57ace644545

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: b85ded41b5302a22f4abc23514c2a57ace644545

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: b85ded41b5302a22f4abc23514c2a57ace644545

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (ubuntu-latest)
Commit: 543f9020dd649d6df0d6d7f3d5c650617b0a7d6a

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: 543f9020dd649d6df0d6d7f3d5c650617b0a7d6a

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: 543f9020dd649d6df0d6d7f3d5c650617b0a7d6a

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: 543f9020dd649d6df0d6d7f3d5c650617b0a7d6a

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: 543f9020dd649d6df0d6d7f3d5c650617b0a7d6a

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: 543f9020dd649d6df0d6d7f3d5c650617b0a7d6a

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: e4063420efd4a27f6fca6f79cd778a286509318c

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: e4063420efd4a27f6fca6f79cd778a286509318c

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: e4063420efd4a27f6fca6f79cd778a286509318c

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: e4063420efd4a27f6fca6f79cd778a286509318c

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: e4063420efd4a27f6fca6f79cd778a286509318c

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (ubuntu-latest)
Commit: 06cecf614c8565bae6042a63feb525cf6d50ef49

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: 06cecf614c8565bae6042a63feb525cf6d50ef49

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: 06cecf614c8565bae6042a63feb525cf6d50ef49

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: 06cecf614c8565bae6042a63feb525cf6d50ef49

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (ubuntu-latest)
Commit: 219cd280877ad57b9204fa8c23d630b000b86cc2

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: 219cd280877ad57b9204fa8c23d630b000b86cc2

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: 219cd280877ad57b9204fa8c23d630b000b86cc2

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: 219cd280877ad57b9204fa8c23d630b000b86cc2

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: 219cd280877ad57b9204fa8c23d630b000b86cc2

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: 219cd280877ad57b9204fa8c23d630b000b86cc2

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: e27a844ec3930e922140b839192e9db82e4f4639

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (ubuntu-latest)
Commit: 11ac79089aec85206e83595f4c9db8f07b6dea44

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: 11ac79089aec85206e83595f4c9db8f07b6dea44

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: 11ac79089aec85206e83595f4c9db8f07b6dea44

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: 11ac79089aec85206e83595f4c9db8f07b6dea44

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: 11ac79089aec85206e83595f4c9db8f07b6dea44

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (macos-latest)
Commit: 4e8113ff66f19467e4cf676dcd7ceee5a6c76c24

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (ubuntu-latest)
Commit: 4e8113ff66f19467e4cf676dcd7ceee5a6c76c24

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (macos-latest)
Commit: 4e8113ff66f19467e4cf676dcd7ceee5a6c76c24

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Maven Project / Test  (windows-latest)
Commit: 4e8113ff66f19467e4cf676dcd7ceee5a6c76c24

:construction: This comment is under construction and will be updated on completion. :construction:

Diffblue Cover

Run: Test: Gradle Project / Test  (windows-latest)
Commit: 4e8113ff66f19467e4cf676dcd7ceee5a6c76c24

:construction: This comment is under construction and will be updated on completion. :construction:


How to add new kinds of nodes at runtime? Thanks! XD

Hello, this really is simply a masterpiece!
I'm going to make a visual programming language with the help of it, so I'd like to be able to dynamically add new kinds of nodes at runtime.
However, from what I understand, it seems that I can only add nodes by registering subclasses of NodeDelegateModel at the beginning of the program. Is it possible to add nodes dynamically at runtime of the program?

In other words, how should I generate the nodes of the NodeDelegateModel subclass at runtime?


[HOLD for payment 2023-07-12] [$1000] Web -Thread - When deleting the last unread message, the "New" marker briefly appears for a second before disappearing

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

Action Performed:
1 Open a chat
2. Send a message to the user
3. Click on "Reply in thread"
4. Send two messages in the thread
5. Click on "Mark as unread" on first thread message messages
6. Delete the messages one by one
Expected Result:
The "New" marker should be removed when deleting the unread message
Actual Result:
"New" marker briefly appears when deleting the last message
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Version Number: <IP_ADDRESS>
Reproducible in staging?: yes
Reproducible in production?: yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/93399543/b32da3fb-0e1d-4245-b612-476b637a90cb
https://github.com/Expensify/App/assets/93399543/67e67db4-575d-4074-8f1f-9655c62b5d5a
Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686211740166899
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~0160cacdcc601320a8
Upwork Job ID:<PHONE_NUMBER>152397312
Last Price Increase: 2023-06-19

Proposal
Please re-state the problem that we are trying to solve in this issue.
Web -Thread - When deleting the last unread message, the "New" marker briefly appears for a second before disappearing
What is the root cause of that problem?
this because the message content hide immediately but the "New Line" hide after componentDidUpdate and pass props down
What changes do you think we should make in order to solve the problem?
we need to hide the "New Line" immeditally like message content by add this case props.action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE
// {props.shouldDisplayNewMarker && <UnreadActionIndicator reportActionID={props.action.reportActionID} />}
{props.shouldDisplayNewMarker && props.action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && <UnreadActionIndicator reportActionID={props.action.reportActionID} />}

What alternative solutions did you explore? (Optional)

Is the green line what we're referring to as marker? If yes - I see it. But the marked as unread thread does go away from the LHN. There is also another bug. In the main room, this chat still shows 3 replies although it's been deleted. Can we fix them both together? Here is the recording
https://github.com/Expensify/App/assets/14225673/a6f6f670-bce6-4837-a0fc-6717c649a33f

Proposal
Please re-state the problem that we are trying to solve in this issue.
When deleting the last unread message, UnreadIndicator appears for a second before disappearing.
What is the root cause of that problem?
@ahmedGaber93's analysis is correct. When deleting message, message's pending action is set to delete and the OfflineWithFeedback component hides all its children in this case. But I think the root cause of this issue is that the UnreadActionIndicator is outside of the OfflineWithFeedback
https://github.com/Expensify/App/blob/b0e8364915e5d950df548fa577487fc41dfc7cb0/src/pages/home/report/ReportActionItem.js#L437
What changes do you think we should make in order to solve the problem?
I suggest to place the UnreadActionIndicator inside the OfflineWithFeedback
https://github.com/Expensify/App/blob/b0e8364915e5d950df548fa577487fc41dfc7cb0/src/pages/home/report/ReportActionItem.js#L461
This works perfect
What alternative solutions did you explore? (Optional)

https://github.com/Expensify/App/issues/20861 is slightly different, but seems like it might be related. Basically, when you scroll up after deleting a message, it shows the "New message" pill. The exact same action (deleting a message that was just marked unread), so I think it makes sense to solve both issues together. @mollfpr what do you think?

@s-alves10
I think place UnreadActionIndicator inside OfflineWithFeedback will let it inherit its style.
https://github.com/Expensify/App/blob/b0e8364915e5d950df548fa577487fc41dfc7cb0/src/pages/home/report/ReportActionItem.js#L447-L452
for example, if we force offline mode and delete message has "New marker", the UnreadActionIndicator will inherit deleted-item style with opacity 0.5

@sakluger Are these 2 issues the same?
IMO, no.

Here, the New message marker was disappearing with a delay because we had no logic to update it before network call finished. I think that the Proposals for this issue would have hidden it from the corresponding component & would have not gotten rid of the other issue as is the case with this one.
There, the New Messages pill was remaining indefinitely because the state of newMarkerReportActionID was not cleared after the network call. So, the fix for that problem would have been clearing the newMarkerReportActionID state after the network call, making the New Messages pill disappear with a delay(as is the case with this issue). I think that the Proposals for that one would have not gotten rid of this one, as it's the case with this one.

Regardless of the conclusion, from my testings this Proposal fixes them both and it's a good thing we found them. Let me know if you find any issues while testing this.

Thank you guys for the proposal!
I agree with @DanutGavrus root cause, but the solution is still imperfect.
@DanutGavrus this.props.reportActions[0] why it only checks the first action? The indicator persists if I delete other than the last action.
https://github.com/Expensify/App/assets/25520267/aa437313-cceb-482d-933d-7bf975a67980

@mollfpr This is the current behavior of the app by design. I did the same tests without my changes on the current main branch, staging, and production. I assume that even if you deleted the marked message, by design the other messages are not considered read by the app.
Could you please test this against staging and let me know if it behaves the same or in a different way?

@DanutGavrus Yeah, you're right.
@sakluger Should this issue only specific for the last unread message?

Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - Thread - When deleting the last unread message, the "New" marker briefly appears for a second before disappearing & New Message Notification Persists After Message is Deleted.
What is the root cause of that problem?
Currently, if the variable newMarkerReportActionID is not empty, we display the FloatingMessageCounter component. This logic can be found in the following code snippet on GitHub:
https://github.com/Expensify/App/blob/205899fe2db8e848e732d9ab6ba7ea34c3dfd413/src/pages/home/report/ReportActionsView.js#L212-L218
Additionally, in the componentDidUpdate method, when a message is deleted, we update the value of newMarkerReportActionID if there are other unread messages. However, the issue arises when the user deletes the last unread message, as newMarkerReportActionID is not set to an empty string (''), and instead retains the previous value set earlier.
What changes do you think we should make in order to solve the problem?
To achieve the goal of hiding the "New" message line along with the message content, we can modify the renderReportActionItem function, by placing the new marker inside the content, it will be hidden when the content is hidden.
Here is an example of how you can update the renderReportActionItem function:
        const content = renderItemContent(hovered || isContextMenuActive);
        const shouldDisplayNewMarker = props.shouldDisplayNewMarker && <UnreadActionIndicator reportActionID={props.action.reportActionID} />;
        if (props.draftMessage) {
            return (
                <>
                    {shouldDisplayNewMarker}
                    <ReportActionItemDraft>{content}</ReportActionItemDraft>;
                </>
            );
        }
        if (!props.displayAsGroup) {
            return (
                <>
                    {shouldDisplayNewMarker}
                    <ReportActionItemSingle
                        action={props.action}
                        showHeader={!props.draftMessage}
                        wrapperStyles={[styles.chatItem, isWhisper ? styles.pt1 : {}]}
                        shouldShowSubscriptAvatar={props.shouldShowSubscriptAvatar}
                        report={props.report}
                        hasBeenFlagged={!_.contains([CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING], moderationDecision)}
                    >
                        {content}
                    </ReportActionItemSingle>
                </>
            );
        }

@mollfpr if both issues stem from the same or very similar root cause, and we can fix them both in one issue rather than two, I'd rather consolidate the two issues.
@anmurali what do you think? Should we fix both this issue and https://github.com/Expensify/App/issues/20861 together?

@sakluger @mollfpr  @anmurali The above solution I have shared fixes both this issues and #20861.
If you have any further questions or need additional assistance, feel free to reach out.

@PardeepSensation I just tested your solution, but it didn't work. It's not even showing the marker at all. Also, you mentioned newMarkerReportActionID is the problem, but I didn't find your solution related to your root cause.
@sakluger It can be fixed for both issues, but I'm unsure if the other issue is specific to the last message.
My concern is if we delete the message which not the last one, the new message marker is moved to the next message. I'm not sure if this is expected or not.
https://github.com/Expensify/App/assets/25520267/39a75798-dac7-41d4-868a-669179f3b415

@mollfpr @sakluger

My concern is if we delete the message which not the last one, the new message marker is moved to the next message. I'm not sure if this is expected or not.

We've introduced the unread method here in this PR and we are now using it as follows:

We make sure that the report has unread messages by calling isUnread(report):
https://github.com/Expensify/App/blob/0b7455fa832b53eccb99ca23c70e131b3464fb1d/src/libs/ReportUtils.js#L1779-L1788
Is it has, we return the last actionID(last here being the oldest one) which has the creation date reportAction.created > the last message which was actually read from the report report.lastReadTime:
https://github.com/Expensify/App/blob/0b7455fa832b53eccb99ca23c70e131b3464fb1d/src/libs/ReportUtils.js#L2016-L2024
The newMarkerReportActionID gets set to that so that's why we see the New notifiers on the next message instead of going away.

It works the same in this proposal and on the current staging as it seems to be the default chosen behavior since implemented. I think it's not hard to modify this behavior, but if report.lastReadTime comes from back-end, maybe we'll need some changes there too? Wouldn't that be outside of the scope of this issue? I'm not sure, just did some research and thought of asking your opinions too.

@mollfpr, could you please recheck my solution? I have tested it on my end, and it works as demonstrated in the video. I have provided the entire 'ReportActionItem.js' file below. You can replace your file with mine and verify the solution.
The issue arises because currently, the content is deleted before the 'new marker', causing the problem. My solution suggests placing the marker at the same location as the content. If the content is hidden, the new marker will also be deleted.
Alternatively, we could modify the database by adding a field for unread messages. If a message is deleted, the new marker will not be visible because the 'unread' field will not be found. However, implementing this change will require modifying multiple files.
demo.webm
import lodashGet from 'lodash/get';
import React, {useState, useRef, useEffect, memo, useCallback} from 'react';
import {InteractionManager, View} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import CONST from '../../../CONST';
import ONYXKEYS from '../../../ONYXKEYS';
import reportActionPropTypes from './reportActionPropTypes';
import * as StyleUtils from '../../../styles/StyleUtils';
import PressableWithSecondaryInteraction from '../../../components/PressableWithSecondaryInteraction';
import Hoverable from '../../../components/Hoverable';
import Button from '../../../components/Button';
import ReportActionItemSingle from './ReportActionItemSingle';
import ReportActionItemGrouped from './ReportActionItemGrouped';
import MoneyRequestAction from '../../../components/ReportActionItem/MoneyRequestAction';
import ReportActionItemMessage from './ReportActionItemMessage';
import UnreadActionIndicator from '../../../components/UnreadActionIndicator';
import ReportActionItemMessageEdit from './ReportActionItemMessageEdit';
import ReportActionItemCreated from './ReportActionItemCreated';
import ReportActionItemThread from './ReportActionItemThread';
import LinkPreviewer from './LinkPreviewer';
import compose from '../../../libs/compose';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import ControlSelection from '../../../libs/ControlSelection';
import * as DeviceCapabilities from '../../../libs/DeviceCapabilities';
import MiniReportActionContextMenu from './ContextMenu/MiniReportActionContextMenu';
import * as ReportActionContextMenu from './ContextMenu/ReportActionContextMenu';
import * as ContextMenuActions from './ContextMenu/ContextMenuActions';
import {withBlockedFromConcierge, withNetwork, withPersonalDetails, withReportActionsDrafts} from '../../../components/OnyxProvider';
import RenameAction from '../../../components/ReportActionItem/RenameAction';
import InlineSystemMessage from '../../../components/InlineSystemMessage';
import styles from '../../../styles/styles';
import SelectionScraper from '../../../libs/SelectionScraper';
import focusTextInputAfterAnimation from '../../../libs/focusTextInputAfterAnimation';
import * as User from '../../../libs/actions/User';
import * as ReportUtils from '../../../libs/ReportUtils';
import OfflineWithFeedback from '../../../components/OfflineWithFeedback';
import * as ReportActions from '../../../libs/actions/ReportActions';
import * as ReportActionsUtils from '../../../libs/ReportActionsUtils';
import reportPropTypes from '../../reportPropTypes';
import {ShowContextMenuContext} from '../../../components/ShowContextMenuContext';
import ChronosOOOListActions from '../../../components/ReportActionItem/ChronosOOOListActions';
import ReportActionItemReactions from '../../../components/Reactions/ReportActionItemReactions';
import * as Report from '../../../libs/actions/Report';
import withLocalize from '../../../components/withLocalize';
import Icon from '../../../components/Icon';
import * as Expensicons from '../../../components/Icon/Expensicons';
import Text from '../../../components/Text';
import DisplayNames from '../../../components/DisplayNames';
import personalDetailsPropType from '../../personalDetailsPropType';
import ReportPreview from '../../../components/ReportActionItem/ReportPreview';
import ReportActionItemDraft from './ReportActionItemDraft';
import TaskPreview from '../../../components/ReportActionItem/TaskPreview';
import TaskAction from '../../../components/ReportActionItem/TaskAction';
import * as Session from '../../../libs/actions/Session';
import {hideContextMenu} from './ContextMenu/ReportActionContextMenu';

const propTypes = {
    ...windowDimensionsPropTypes,

    /** Report for this action */
    report: reportPropTypes.isRequired,

    /** All the data of the action item */
    action: PropTypes.shape(reportActionPropTypes).isRequired,

    /** Should the comment have the appearance of being grouped with the previous comment? */
    displayAsGroup: PropTypes.bool.isRequired,

    /** Is this the most recent IOU Action? */
    isMostRecentIOUReportAction: PropTypes.bool.isRequired,

    /** Should we display the new marker on top of the comment? */
    shouldDisplayNewMarker: PropTypes.bool.isRequired,

    /** Determines if the avatar is displayed as a subscript (positioned lower than normal) */
    shouldShowSubscriptAvatar: PropTypes.bool,

    /** Position index of the report action in the overall report FlatList view */
    index: PropTypes.number.isRequired,

    /** Draft message - if this is set the comment is in 'edit' mode */
    draftMessage: PropTypes.string,

    /* Whether the option has an outstanding IOU */
    // eslint-disable-next-line react/no-unused-prop-types
    hasOutstandingIOU: PropTypes.bool,

    /** Stores user's preferred skin tone */
    preferredSkinTone: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),

    /** All of the personalDetails */
    personalDetails: PropTypes.objectOf(personalDetailsPropType),
};

const defaultProps = {
    draftMessage: '',
    preferredSkinTone: CONST.EMOJI_DEFAULT_SKIN_TONE,
    personalDetails: {},
    shouldShowSubscriptAvatar: false,
    hasOutstandingIOU: false,
};

function ReportActionItem(props) {
    const [isContextMenuActive, setIsContextMenuActive] = useState(ReportActionContextMenu.isActiveReportAction(props.action.reportActionID));
    const [isHidden, setIsHidden] = useState(false);
    const [moderationDecision, setModerationDecision] = useState(CONST.MODERATION.MODERATOR_DECISION_APPROVED);
    const textInputRef = useRef();
    const popoverAnchorRef = useRef();
    const downloadedPreviews = useRef([]);

    const isDraftEmpty = !props.draftMessage;
    useEffect(() => {
        if (isDraftEmpty) {
            return;
        }

        focusTextInputAfterAnimation(textInputRef.current, 100);
    }, [isDraftEmpty]);

    useEffect(() => {
        const urls = ReportActionsUtils.extractLinksFromMessageHtml(props.action);
        if (_.isEqual(downloadedPreviews.current, urls) || props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
            return;
        }

        downloadedPreviews.current = urls;
        Report.expandURLPreview(props.report.reportID, props.action.reportActionID);
    }, [props.action, props.report.reportID]);

    // Hide the message if it is being moderated for a higher offense, or is hidden by a moderator
    // Removed messages should not be shown anyway and should not need this flow

    useEffect(() => {
        if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(props.action.message[0].moderationDecisions)) {
            return;
        }

        // Right now we are only sending the latest moderationDecision to the frontend even though it is an array
        let decisions = props.action.message[0].moderationDecisions;
        if (decisions.length > 1) {
            decisions = decisions.slice(-1);
        }
        const latestDecision = decisions[0];
        if (latestDecision.decision === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE || latestDecision.decision === CONST.MODERATION.MODERATOR_DECISION_HIDDEN) {
            setIsHidden(true);
        }
        setModerationDecision(latestDecision.decision);

        // props.action.message doesn't need to be a dependency, we only need to check the change of props.action.message[0].moderationDecisions
        // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [props.action.message[0].moderationDecisions, props.action.actionName]);

    const toggleContextMenuFromActiveReportAction = useCallback(() => {
        setIsContextMenuActive(ReportActionContextMenu.isActiveReportAction(props.action.reportActionID));
    }, [props.action.reportActionID]);

    /**
     * Show the ReportActionContextMenu modal popover.
     *
     * @param {Object} [event] - A press event.
     */
    const showPopover = useCallback(
        (event) => {
            // Block menu on the message being Edited or if the report action item has errors
            if (props.draftMessage || !_.isEmpty(props.action.errors)) {
                return;
            }

            setIsContextMenuActive(true);

            const selection = SelectionScraper.getCurrentSelection();
            ReportActionContextMenu.showContextMenu(
                ContextMenuActions.CONTEXT_MENU_TYPES.REPORT_ACTION,
                event,
                selection,
                popoverAnchorRef,
                props.report.reportID,
                props.action,
                props.draftMessage,
                () => {},
                toggleContextMenuFromActiveReportAction,
                ReportUtils.isArchivedRoom(props.report),
                ReportUtils.chatIncludesChronos(props.report),
            );
        },
        [props.draftMessage, props.action, props.report, toggleContextMenuFromActiveReportAction],
    );

    const toggleReaction = useCallback(
        (emoji) => {
            Report.toggleEmojiReaction(props.report.reportID, props.action, emoji);
        },
        [props.report, props.action],
    );

    /**
     * Get the content of ReportActionItem
     * @param {Boolean} hovered whether the ReportActionItem is hovered
     * @returns {Object} child component(s)
     */
    const renderItemContent = (hovered = false) => {
        let children;
        const originalMessage = lodashGet(props.action, 'originalMessage', {});

        // IOUDetails only exists when we are sending money
        const isSendingMoney = originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails');

        // Show the IOUPreview for when request was created, bill was split or money was sent
        if (
            props.action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU &&
            originalMessage &&
            // For the pay flow, we only want to show MoneyRequestAction when sending money. When paying, we display a regular system message
            (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE || originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT || isSendingMoney)
        ) {
            // There is no single iouReport for bill splits, so only 1:1 requests require an iouReportID
            const iouReportID = originalMessage.IOUReportID ? originalMessage.IOUReportID.toString() : '0';
            children = (
                <MoneyRequestAction
                    chatReportID={props.report.reportID}
                    requestReportID={iouReportID}
                    action={props.action}
                    isMostRecentIOUReportAction={props.isMostRecentIOUReportAction}
                    isHovered={hovered}
                    contextMenuAnchor={popoverAnchorRef}
                    checkIfContextMenuActive={toggleContextMenuFromActiveReportAction}
                    style={props.displayAsGroup ? [] : [styles.mt2]}
                />
            );
        } else if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW) {
            children = (
                <ReportPreview
                    iouReportID={props.action.originalMessage.linkedReportID}
                    chatReportID={props.report.reportID}
                    action={props.action}
                    isHovered={hovered}
                    contextMenuAnchor={popoverAnchorRef}
                    checkIfContextMenuActive={toggleContextMenuFromActiveReportAction}
                />
            );
        } else if (
            props.action.actionName === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED ||
            props.action.actionName === CONST.REPORT.ACTIONS.TYPE.TASKCANCELED ||
            props.action.actionName === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED
        ) {
            children = (
                <TaskAction
                    taskReportID={props.action.originalMessage.taskReportID.toString()}
                    actionName={props.action.actionName}
                />
            );
        } else if (ReportActionsUtils.isCreatedTaskReportAction(props.action)) {
            children = (
                <TaskPreview
                    taskReportID={props.action.originalMessage.taskReportID.toString()}
                    action={props.action}
                    isHovered={hovered}
                />
            );
        } else {
            const message = _.last(lodashGet(props.action, 'message', [{}]));
            const hasBeenFlagged = !_.contains([CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING], moderationDecision);
            const isAttachment = _.has(props.action, 'isAttachment') ? props.action.isAttachment : ReportUtils.isReportMessageAttachment(message);
            children = (
                <ShowContextMenuContext.Provider
                    value={{
                        anchor: popoverAnchorRef,
                        report: props.report,
                        action: props.action,
                        checkIfContextMenuActive: toggleContextMenuFromActiveReportAction,
                    }}
                >
                    {!props.draftMessage ? (
                        <View style={props.displayAsGroup && hasBeenFlagged ? styles.blockquote : {}}>
                            <ReportActionItemMessage
                                action={props.action}
                                isHidden={isHidden}
                                style={[
                                    !props.displayAsGroup && isAttachment ? styles.mt2 : undefined,
                                    _.contains([..._.values(CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG), CONST.REPORT.ACTIONS.TYPE.IOU], props.action.actionName)
                                        ? styles.colorMuted
                                        : undefined,
                                ]}
                            />
                            {hasBeenFlagged && (
                                <Button
                                    small
                                    style={[styles.mt2, styles.alignSelfStart]}
                                    onPress={() => setIsHidden(!isHidden)}
                                >
                                    <Text
                                        style={styles.buttonSmallText}
                                        selectable={false}
                                    >
                                        {isHidden ? props.translate('moderation.revealMessage') : props.translate('moderation.hideMessage')}
                                    </Text>
                                </Button>
                            )}
                        </View>
                    ) : (
                        <ReportActionItemMessageEdit
                            action={props.action}
                            draftMessage={props.draftMessage}
                            reportID={props.report.reportID}
                            index={props.index}
                            ref={textInputRef}
                            report={props.report}
                            // Avoid defining within component due to an existing Onyx bug
                            preferredSkinTone={props.preferredSkinTone}
                            shouldDisableEmojiPicker={
                                (ReportUtils.chatIncludesConcierge(props.report) && User.isBlockedFromConcierge(props.blockedFromConcierge)) || ReportUtils.isArchivedRoom(props.report)
                            }
                        />
                    )}
                </ShowContextMenuContext.Provider>
            );
        }

        const reactions = _.get(props, ['action', 'message', 0, 'reactions'], []);
        const hasReactions = reactions.length > 0;
        const numberOfThreadReplies = _.get(props, ['action', 'childVisibleActionCount'], 0);
        const hasReplies = numberOfThreadReplies > 0;

        const shouldDisplayThreadReplies = hasReplies && props.action.childCommenterCount && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID);
        const oldestFourAccountIDs = lodashGet(props.action, 'childOldestFourAccountIDs', '').split(',');
        const draftMessageRightAlign = props.draftMessage ? styles.chatItemReactionsDraftRight : {};

        return (
            <>
                {children}
                {!_.isEmpty(props.action.linkMetadata) && (
                    <View style={props.draftMessage ? styles.chatItemReactionsDraftRight : {}}>
                        <LinkPreviewer linkMetadata={_.filter(props.action.linkMetadata, (item) => !_.isEmpty(item))} />
                    </View>
                )}
                {hasReactions && (
                    <View style={draftMessageRightAlign}>
                        <ReportActionItemReactions
                            reportActionID={props.action.reportActionID}
                            reactions={reactions}
                            toggleReaction={(emoji) => {
                                if (Session.isAnonymousUser()) {
                                    hideContextMenu(false);

                                    InteractionManager.runAfterInteractions(() => {
                                        Session.signOutAndRedirectToSignIn();
                                    });
                                } else {
                                    toggleReaction(emoji);
                                }
                            }}
                        />
                    </View>
                )}
                {shouldDisplayThreadReplies && (
                    <View style={draftMessageRightAlign}>
                        <ReportActionItemThread
                            childReportID={`${props.action.childReportID}`}
                            numberOfReplies={numberOfThreadReplies}
                            mostRecentReply={`${props.action.childLastVisibleActionCreated}`}
                            isHovered={hovered}
                            icons={ReportUtils.getIconsForParticipants(oldestFourAccountIDs, props.personalDetailsList)}
                        />
                    </View>
                )}
            </>
        );
    };

    /**
     * Get ReportActionItem with a proper wrapper
     * @param {Boolean} hovered whether the ReportActionItem is hovered
     * @param {Boolean} isWhisper whether the ReportActionItem is a whisper
     * @returns {Object} report action item
     */
    const renderReportActionItem = (hovered, isWhisper) => {
        const content = renderItemContent(hovered || isContextMenuActive);
        const shouldDisplayNewMarker = props.shouldDisplayNewMarker && <UnreadActionIndicator reportActionID={props.action.reportActionID} />;
        if (props.draftMessage) {
            return (
                <>
                    {shouldDisplayNewMarker}
                    <ReportActionItemDraft>{content}</ReportActionItemDraft>;
                </>
            );
        }
        if (!props.displayAsGroup) {
            return (
                <>
                    {shouldDisplayNewMarker}
                    <ReportActionItemSingle
                        action={props.action}
                        showHeader={!props.draftMessage}
                        wrapperStyles={[styles.chatItem, isWhisper ? styles.pt1 : {}]}
                        shouldShowSubscriptAvatar={props.shouldShowSubscriptAvatar}
                        report={props.report}
                        hasBeenFlagged={!_.contains([CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING], moderationDecision)}
                    >
                        {content}
                    </ReportActionItemSingle>
                </>
            );
        }

        return (
            <>
                {shouldDisplayNewMarker}
                <ReportActionItemGrouped wrapperStyles={[styles.chatItem, isWhisper ? styles.pt1 : {}]}>{content}</ReportActionItemGrouped>
            </>
        );
    };

    if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) {
        return <ReportActionItemCreated reportID={props.report.reportID} />;
    }
    if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
        return <RenameAction action={props.action} />;
    }
    if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOSOOOLIST) {
        return (
            <ChronosOOOListActions
                action={props.action}
                reportID={props.report.reportID}
            />
        );
    }

    const hasErrors = !_.isEmpty(props.action.errors);
    const whisperedTo = props.action.whisperedTo || [];
    const isWhisper = whisperedTo.length > 0;
    const isMultipleParticipant = whisperedTo.length > 1;
    const isWhisperOnlyVisibleByUser = isWhisper && ReportUtils.isCurrentUserTheOnlyParticipant(whisperedTo);
    const whisperedToPersonalDetails = isWhisper ? _.filter(props.personalDetails, (details) => _.includes(whisperedTo, details.login)) : [];
    const displayNamesWithTooltips = isWhisper ? ReportUtils.getDisplayNamesWithTooltips(whisperedToPersonalDetails, isMultipleParticipant) : [];
    return (
        <PressableWithSecondaryInteraction
            pointerEvents={props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? 'none' : 'auto'}
            ref={popoverAnchorRef}
            onPressIn={() => props.isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
            onPressOut={() => ControlSelection.unblock()}
            onSecondaryInteraction={showPopover}
            preventDefaultContextMenu={!props.draftMessage && !hasErrors}
            withoutFocusOnSecondaryInteraction
        >
            <Hoverable disabled={Boolean(props.draftMessage)}>
                {(hovered) => (
                    <View accessibilityLabel={props.translate('accessibilityHints.chatMessage')}>
                        <MiniReportActionContextMenu
                            reportID={props.report.reportID}
                            reportAction={props.action}
                            isArchivedRoom={ReportUtils.isArchivedRoom(props.report)}
                            displayAsGroup={props.displayAsGroup}
                            isVisible={hovered && !props.draftMessage && !hasErrors}
                            draftMessage={props.draftMessage}
                            isChronosReport={ReportUtils.chatIncludesChronos(props.report)}
                        />
                        <View
                            style={StyleUtils.getReportActionItemStyle(
                                hovered || isWhisper || isContextMenuActive || props.draftMessage,
                                (props.network.isOffline && props.action.isLoading) || props.action.error,
                            )}
                        >
                            <OfflineWithFeedback
                                onClose={() => ReportActions.clearReportActionErrors(props.report.reportID, props.action)}
                                pendingAction={props.draftMessage ? null : props.action.pendingAction}
                                shouldHideOnDelete={!ReportActionsUtils.hasCommentThread(props.action)}
                                errors={props.action.errors}
                                errorRowStyles={[styles.ml10, styles.mr2]}
                                needsOffscreenAlphaCompositing={ReportActionsUtils.isMoneyRequestAction(props.action)}
                            >
                                {isWhisper && (
                                    <View style={[styles.flexRow, styles.pl5, styles.pt2]}>
                                        <View style={[styles.pl6, styles.mr3]}>
                                            <Icon
                                                src={Expensicons.Eye}
                                                small
                                            />
                                        </View>
                                        <Text style={[styles.chatItemMessageHeaderTimestamp]}>
                                            {props.translate('reportActionContextMenu.onlyVisible')}

                                        </Text>
                                        <DisplayNames
                                            fullTitle={ReportUtils.getWhisperDisplayNames(whisperedTo)}
                                            displayNamesWithTooltips={displayNamesWithTooltips}
                                            tooltipEnabled
                                            numberOfLines={1}
                                            textStyles={[styles.chatItemMessageHeaderTimestamp]}
                                            shouldUseFullTitle={isWhisperOnlyVisibleByUser}
                                        />
                                    </View>
                                )}
                                {renderReportActionItem(hovered, isWhisper)}
                            </OfflineWithFeedback>
                        </View>
                    </View>
                )}
            </Hoverable>
            <View style={styles.reportActionSystemMessageContainer}>
                <InlineSystemMessage message={props.action.error} />
            </View>
        </PressableWithSecondaryInteraction>
    );
}

ReportActionItem.propTypes = propTypes;
ReportActionItem.defaultProps = defaultProps;

export default compose(
    withWindowDimensions,
    withLocalize,
    withNetwork(),
    withPersonalDetails(),
    withBlockedFromConcierge({propName: 'blockedFromConcierge'}),
    withReportActionsDrafts({
        propName: 'draftMessage',
        transformValue: (drafts, props) => {
            const draftKey = `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${props.report.reportID}_${props.action.reportActionID}`;
            return lodashGet(drafts, draftKey, '');
        },
    }),
    withOnyx({
        preferredSkinTone: {
            key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
        },
    }),
)(
    memo(
        ReportActionItem,
        (prevProps, nextProps) =>
            prevProps.displayAsGroup === nextProps.displayAsGroup &&
            prevProps.draftMessage === nextProps.draftMessage &&
            prevProps.isMostRecentIOUReportAction === nextProps.isMostRecentIOUReportAction &&
            prevProps.hasOutstandingIOU === nextProps.hasOutstandingIOU &&
            prevProps.shouldDisplayNewMarker === nextProps.shouldDisplayNewMarker &&
            _.isEqual(prevProps.action, nextProps.action) &&
            lodashGet(prevProps.report, 'statusNum') === lodashGet(nextProps.report, 'statusNum') &&
            lodashGet(prevProps.report, 'stateNum') === lodashGet(nextProps.report, 'stateNum') &&
            prevProps.translate === nextProps.translate,
    ),
);

@PardeepSensation Why did your diff delete this code?
    useEffect(
        () => () => {
            // ReportActionContextMenu and EmojiPicker are global component,
            // we use showContextMenu and showEmojiPicker to show them,
            // so we should also hide them when the current component is destroyed
            if (ReportActionContextMenu.isActiveReportAction(props.action.reportActionID)) {
                ReportActionContextMenu.hideContextMenu();
                ReportActionContextMenu.hideDeleteModal();
            }
            if (EmojiPickerAction.isActiveReportAction(props.action.reportActionID)) {
                EmojiPickerAction.hideEmojiPicker(true);
            }
        },
        [props.action.reportActionID],
    );

Why you remove policyID from the ReportActionItemCreated?
        return <ReportActionItemCreated reportID={props.report.reportID} />;

The new marker also moves to the following action after some time.
https://github.com/Expensify/App/assets/25520267/119bd890-830e-4145-9768-a6e061e529d2

Thanks @mollfpr! Just to confirm, will @DanutGavrus's proposal fix both this issue and https://github.com/Expensify/App/issues/20861? If so, I'd like to close the other issue as a duplicate.

@sakluger Yes, it will!

Not overdue, @DanutGavrus you can start working on the PR now. Thanks

@mollfpr @sakluger @techievivek
PR ready to review: PR21557

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

I didn't find offending PR, and this is an improvement for the marker position on the last message deleted.

[@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

The regression step should be enough.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Open any chat;
Send a new message;
Mark it as unread;
Delete the last message;
Verify that the green New marker disappears without delay.
Send enough messages so you can scroll
Mark the last message as unread
Start scrolling up and see that the New Messages* notification appears
Delete the last message
Start scrolling up and verify that no New Messages notification disappears
👍 or 👎

bump @techievivek

Regression steps look good to me.

CCing @anmurali so she can help us get this added to testRail.

@DanutGavrus @mollfpr @ayazhussain79 offers are out, accept them and I'll pay/close. Thanks for your patience!

@garrettmknight  offer accepted, Thank you

@garrettmknight accepted, thanks!

Everyone's paid!


Pls. provide the example of how to handle the event outside nameko

Thanks very much for this very beatiful framework. I just use nameko in a week, and switch my most work architechture to it. I have to use kombu to accept the event message in tornado. As I see the kombu document for these days, I find it difficult for me to understand the process without the rabbitmq experience. Can you help me to provide the example how to get event_handler outside nameko using kombu.
class ServiceA:
    """ Event dispatching service. """
    name = "service_a"

    dispatch = EventDispatcher()

    @rpc
    def dispatching_method(self, payload):
        self.dispatch("event_type", payload)

I make a simple example for it. One process can accept the message. But two processes will accept only a part of messages each. I can't find how to get the broadcast message in many processes. Because tornado websocket can not use sub thread to accept the 'while true' message, how to write the 'while true' in 'async def' coroutine to 'await drain_events()'?
from kombu import Connection, Exchange, Queue
exchange=Exchange('service_a.events', 'topic', durable=True, auto_delete=True)
queue=Queue('hello', exchange=exchange, routing_key='event_type')

def process_msg(body, message):
    print(body)
    message.ack()

with Connection('pyamqp://guest:guest@localhost') as conn:
    with conn.Consumer(queue, callbacks=[process_msg]) as consumer:
        while True:
            conn.drain_events()

How to accept this event with SERVICE_POOL and BROADCAST method in kombu without nameko. I think the example will be very helpful to add to the nameko document. Or it is best to provide a standalone event_handler just like the standalone rpc service.
Although I have not met the problem, but I think it useful to send the event outside nameko, and accept the event in nameko is also welcome. Guessing tornado accept a message from user, and I want to send this message to many potential services, maybe broadcast the event is useful.
class ServiceB:
    """ Event listening service. """
    name = "service_b"

    @event_handler("service_a", "event_type")
    def handle_event(self, payload):
        print("service b received:", payload)

How to send the event with SERVICE_POOL and BROADCAST method in kombu without nameko. The examples are very important for us without rabbitmq experiences. So kindly and patiently providing the examples is welcome. Thanks a lot.

Your message to the mailing list got stuck in moderation, so I've answered it there rather than on this duplicate.


Segfault during tests for test_indirection_scalar_range_nsdfg

tests/python_frontend/indirections_test.py::test_indirection_scalar_range_nsdfg fails with a segfault for multiple PRs' test runs. This seems to be unrelated to the changes of the PRs. Currently, it looks like an issue in the test environment.
Interestingly, they only fail for Python 3.12 without simplification/optimization (3.12, 0), whereas Python 3.12 without simplification/optimization (3.7, 0) seems to succeed.
Apparently, just re-running solves the problem (https://github.com/spcl/dace/pull/1413#issuecomment-1787671991).
Here is an example of such a failure: https://github.com/spcl/dace/actions/runs/6695256570/job/18190421374

Maybe we should deactivate this test until we could fix it, so PR testing stays efficient.

Maybe we should deactivate this test until we could fix it, so PR testing stays efficient.

Not sure if I'm in favor of disabling, it may lead to the test just dying out because no one bothers to fix it. This way everyone is reminded of the issue.

Maybe we should deactivate this test until we could fix it, so PR testing stays efficient.

Not sure if I'm in favor of disabling, it may lead to the test just dying out because no one bothers to fix it. This way everyone is reminded of the issue.

I agree. I meant that we disable, but clearly have someone (most likely me) assigned to it.
Seems to look better now. I think we can keep the issue open for a bit longer, but it may have resolved itself meanwhile.

We haven't seen this in a while. Closing it for now.


Controller promises should use a scope context variable

When the leaflet directive controller is required by a dependent directive, the directive can call .getMap(). The current implementation works fine when using only one map on a page but when using two, the wrong promise may be returned, depending on when the .getMap() call is made.
The culprit is this line. It should be using a scoped deferred as seen in other controllers like in the layers controller.
There are examples for multiple maps on a page that function properly but I think that due to the lifecycle of angular and when the .getMap() call is made, it happens to work.
I believe this is true other directive controllers, as seen in the center directive.

Hi @joeljeske, sorry for the late response.
In theory, you can access the required map passing a parameter to the getMap call, the id of the leaflet object you created prevously.
I have an example illustrating this:
http://tombatossals.github.io/angular-leaflet-directive/examples/0000-viewer.html#/basic/double-map-access-map-object-example
Doest this solve your issue, or I haven't fully understand you?

No that is not quite what I was asking. I should have provided links to specific commits.
The issue has been fixed with this commit. The _leafletMap promise was a single variable instead of a reference on the controller or on the $scope.

Sorry, you're right, thtat's because not all the issues can be processed at the same time the code evolves. I know the problem you're refering now.
Thanks for your detailed information in any case


allinone: add join subcommand to join the existing k8s

This aims to the simulation of multi edge virutal nodes on a single node,
and join the existing Kubernetes cluster, also supports the cluster
created by this allinone script.
Signed-off-by: llhuii<EMAIL_ADDRESS>

A temporary katacoda course for this: https://www.katacoda.com/sedna-ai/scenarios/all-in-one-2


Cut/Copy selected tracks sends: Runs if no sends on tracks

I consider this a bug.
If there are no sends on a track, then these actions will erase any previously cut/copied sends in the clipboard, effectively "cutting/copying no sends". This is pretty nonstandard behavior – as a user I would expect that the action would do nothing if no sends are found on the tracks.

Makes sense for these actions in isolation, however changing the behavior may have undesirable side effects:

"SWS/S&M: Copy selected tracks (with routing)" -> Shouldn't this continue to clear the send/receive clipboard if copied tarcks have no sends/receives?
"SWS/S&M: Copy selected tracks routings" -> What should happen if there are sends but no receives (or vice versa)? Clear the receive clipboard (current behavior)? Keep previous contents (suggested behavior)?

This post was specifically about the actions to cut/copy sends specifically.
I don't think the two actions you name ought to be changed...

👍 I've added special cases to "{Copy,Cut} selected tracks {sends,receives,routings}" for consistency while preserving the existing clipboard-clearing behavior if there's either sends or receives to copy or if it's "Copy selected tracks (with routing)". (All these actions run the same code.)
There are builds here if you'd like to try: https://github.com/reaper-oss/sws/pull/1690#issuecomment-1276870440.

Sounds good!
I just tried out the new beta you linked and while Copy sends does not overwrite sends anymore (thanks!), I noticed that identical sends don't get copied – it only copies one of them. Is that intentional?

I noticed that identical sends don't get copied – it only copies one of them. Is that intentional?

Can't duplicate here (tried creating two identical sends from track 1 to track 2, selected track 1, ran "Copy sends", selected track 3, ran "Paste sends" and it got both). Which steps are you using?
(Updated the build, fixed bugs occurring when not all selected tracks have sends.)

I noticed that identical sends don't get copied – it only copies one of them. Is that intentional?

Can't duplicate here

I just tried again and realized that it was user error. Apologies for that, works great! ack

Thanks!


Create a build with libc++ on Linux

libc++ is (in some respects) a more strict implementation of the standard C++ library than the stock libstdc++ included in most Linux distributions.  Currently the only build that uses libc++ is the macOS build, which is fairly slow, excluded from PRs, and thus problems can go undetected for a while (see #183).  If we can configure a build on Linux with Clang and libc++ then these problems would be detected earlier, and we would have higher confidence that the macOS build would succeed.
For what is worth, Fedora has packages for libc++ under libcxx-devel and libcxxabi-devel.

I decided to tackle this but I've run into a couple of issues:

I presumed that the new GCC ABI would be compatible with libc++, yet when trying to link googletest it complains about std::string errors. So either my assumption is wrong or I'm missing something w.r.t. googletest

CMake doesn't seem to have a clean way to switch standard libraries. So I resort to set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") and CMAKE_FLAGS="${CMAKE_FLAGS} -DCMAKE_CXX_FLAGS=\"-stdlib=libc++\"". the latter is undesirable since overriding CMAKE_CXX_FLAGS manually is considered an anti-pattern these days and the former isn't exactly clean

Furthermore, I pair this with TEST_INSTALL=yes to make sure the dependencies get compiled with libc++. However, another build failure happens with grpc:
/usr/bin/ld: CMakeFiles/grpc_ruby_plugin.dir/src/compiler/ruby_plugin.cc.o:
(.data.rel.ro._ZTV17RubyGrpcGenerator[_ZTV17RubyGrpcGenerator]+0x28): undefined reference to
 `google::protobuf::compiler::CodeGenerator::GenerateAll(std::vector<google::protobuf::FileDescriptor
 const*, std::allocator<google::protobuf::FileDescriptor const*> > const&,
 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
 google::protobuf::compiler::GeneratorContext*, std::__cxx11::basic_string<char,
 std::char_traits<char>, std::allocator<char> >*) const'
# ...snip...

I wonder if -D_GLIBCXX_USE_CXX11_ABI=1 is necessary here, but I'm sure my approach is flawed.

@remyabel I have assigned this to you for the time being, we can clear that at any time.
One thing to try is to build with Bazel, which is better at doing hermetic builds and compiling all the dependencies with the same compiler options.  The Bazel scripts would need some non-trivial changes I expect.
If we are using CMake: one thing to keep in mind is that building with external projects (aka TEST_INSTALL=no) or with pre-installed packages involves calling completely separate invocations of CMake.  Setting flags like CMAKE_CXX_FLAGS in our CMakeLists.txt file would have no effect in the invocations to build gRPC, protobuf, or googletest. I believe we will need to resort to environment variables so all the CMake invocations get these flags (yuck).

Setting flags like CMAKE_CXX_FLAGS in our CMakeLists.txt file would have no effect in the invocations to build gRPC, protobuf, or googletest

No, I'm actually setting CMAKE_FLAGS inside build_docker.sh. Generally overriding an external project's CMAKE_CXX_FLAGS is bad practice but I don't see an easier approach short of patching those projects.

Ah, I'm blind. I didn't see:
  -DgRPC_CARES_PROVIDER=package \
  -DgRPC_PROTOBUF_PROVIDER=package \

So it wasn't linking against the thing I just compiled. I will avoid using TEST_INSTALL then.

Update on this. I decided to scrap my flawed approach and do something like the following. For each external dependency I just add to the import targets:
if (USE_LIBCXX)
    set_property(TARGET GTest::gmock
                 APPEND
                 PROPERTY INTERFACE_COMPILE_OPTIONS
                          "-stdlib=libc++")

    set_property(TARGET GTest::gmock
                 APPEND
                 PROPERTY INTERFACE_LINK_LIBRARIES
                          "c++abi")
    # etc.
endif ()

This seems to do the job pretty well. The only outliers are OpenSSL and NlohmannJson judging from the error messages I'm getting.

Have you considered adding these options to the google_cloud_cpp_common_options library?  It is a pure INTERFACE that all targets should link into, and therefore all targets "inherit" whatever options you add to google_cloud_cpp_common_options.
OpenSSL is a pure C library, and NlohmannJson is a pure header library.

Yes, I had that as well. Something like:
function (google_cloud_cpp_add_common_options target)
  # ...
  if (USE_LIBCXX)
    target_compile_options(${target} INTERFACE "-stdlib=libc++")
  endif ()
endfunction()

Then:
target_link_libraries(google_cloud_cpp_common
                      PUBLIC Threads::Threads
                             $<$<BOOL:${USE_LIBCXX}>:c++abi> # or INTERFACE
                      PRIVATE google_cloud_cpp_common_options)

I understand that INTERFACE dependencies are supposed to be transitive, but there are issues somewhere.


bring ecr-controller to ACK runtime v0.11.0

Updates the ACK runtime for ECR controller to v0.11.0, which brings in
lots of new features including LateInitialize, better delta handling,
better logging and corrected release artifact generation.
Note to reviewers: please check out the changes I made to
pkg/resource/repository/custom_update_api.go. I had to change the
delta.DifferentAt calls to reference Spec. and I added the common
resource logging traces into the sub-functions for handling the custom
update calls for repository attributes.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

/test ecr-release-test

/lgtm

/approve
/lgtm

/approve


dense net training from scratch accuracy keeps dropping

Hi,
This is great, thanks for sharing the code!
I was using your code with processed TuSimple data trying to train dense net model from scratch according to your training procedure and config. While the training loss keeps decreasing, the accuracy also keeps decreasing (from around 0.5 at the beginning down to now close to 0.03 at the 500th epoch). I am using the same learning rate setup as your suggested setup. Any thoughts on why this is happening?

@cxy7452 Since I have not find a suitable pre-trained weights on dense net yet all my experiments was done using the vgg structure as the base cnn net

Hello, @cxy7452 :
How do you train? I have a problem with nan .(https://github.com/MaybeShewill-CV/lanenet-lane-detection/issues/4)
Do you need to read the json file during training? Or just need train.txt 、 val.txt、binary segmentation label file 、 instance segmentation label file and the original image ?
thank you :)

Hi , @cxy7452:
Thank you for your reply.
My training data is as follows:
original image:

gt_image_binary:

gt_image_instance:

The path of the above three is recorded in train.txt
Is this correct? thank you :)

@yiyichun The label image looks correct for now. You'd better check the label follow the readme.md file

Hi, @MaybeShewill-CV ,
Does the image file need png file? Is the jpg image file available?

@yiyichun jpg file is also accepted. But you have to make sure the pixel value of the label image is right.

Hi,@yiyichun ,
How is your gt_image_binary and gt_iamge_instance generated?

Hi, @ding-hai-tao ,
I am modifying data_provider\lanenet_hnet_data_processor.py to get these 2 files.
However, I am not sure if this is correct, maybe @MaybeShewill-CV  can have correct instructions.

Hello, I also meet the problem that dense net training from scratch accuracy keeps dropping , can you share some experience? @cxy7452 @MaybeShewill-CV @yiyichun @ding-hai-tao

@south-ocean You'd better use pretrained dense net weights params as initialized weights.

@south-ocean ,
I have also encountered the same problem. Try to reduce the learning rate.

Your solution didn't resolve my problem, can you leave me a Contact？ Thank  you! @yiyichun @MaybeShewill-CV @cxy7452

@south-ocean You can try this if the solution can resolve your problem. #33  @mukaman84

@MaybeShewill-CV  @yiyichun  @cxy7452 I have decreased my initial learning rate to 0.00005 and 0.0002, but it also did't work. I train the network on culane dataset and base on the vgg16.py.  My  result  is up and down just as the picture show. Can you have some suggestion. I think this is a stranger phenomenon.


Bug using set{FieldCamelCase} with DateTimeType

A little bug should it self while developing my current app and its due to the autoloaded "set{FieldCamelCase}".
I think there should be an option to toggle enable or disable on this feature similar to validate.
abstract class BaseModel extends \Spot\Entity
{
 public static function events(EventEmitter $eventEmitter)
    {
        $eventEmitter->on('beforeSave',function (EntityInterface $entity, MapperInterface $mapper){
            $entity->setCreatedAt();
        });
    }
    public function setCreatedAt() {
        $this->created_at = new DateTime;
     }
}

class ObjectModel extends BaseModel
{
    ...
    public static function fields()
    {
        return [
             ...
            'created_at' => ['type' => 'datetime']
        ];
    }
    ...
}

This make DBAL produce an error Call to undefined method App\\Object::format() since the value passed to
Doctrine\\DBAL\\Types\\DateTimeType->convertToDatabaseValue was an object instead of string.
This bug goes away if I rename the setCreatedAt method to something else.

The preferred way of initializing the DateTime field is this:
class ObjectModel extends BaseModel
{
    ...
    public static function fields()
    {
        return [
             ...
            'created_at' => ['type' => 'datetime', 'value' => new \DateTime()]
        ];
    }
    ...
}

To be honest your solution is pretty pointless and slow.

"It's not a bug, it's a feature™"
The set{FieldCamelCase} methods are indeed somewhat reserved for setters. Since your getCreatedAt-method returns nothing, I was expecting created_at to be null to be honest.
You have options:

use @FlipEverything 's solution, but know that this sets the datetime when the entity is built, not saved so there might be a few milliseconds difference (probably doesn't matter in daily life, but still)
have setCreatedAt() return a new DateTime()
just use $entity->created_at = new DateTime() in the event handler
choose a different name for the setCreatedAt function
or even set created_at in the __construct() method

What @FlipEverything suggested is probably the easiest, most elegant way.

Thanks.  @willemwollebrants I the problem was setCreatedAt not returning a DateTime object. I knew it was a feature and only thought if it could be toggled.  Just wondering why you said created_at should be null.


CLI method for getting Genius ID

Would be nice if there were a way to do this through the Command-line. As of now there's a way to query using the genius ID, but no way to get Genius IDs...

handled like this:
python3 main.py "SEARCH TERM" --genius_id
Prints GeniusIDs along with the songname and artistname for the top 10 results from Genius


Using symfony's JsonResponse in UserController

Hello @ceckoslab
Here are the changes required in order to deploy Symfonys way to output Json data
Kindly review
Thanks

Hello @korzol
Could you please check again the the task definition? Reference: https://github.com/basicrum/backoffice/issues/143
I think that this part of requirement is completely missing:

If they do not use $this->json() then convert them in a way so they use $this->json().

Hello @ceckoslab
Here it is.
Kindly review


Hotkeys not working on arch Linux

❯ python main.py
Using faster-whisper model: base.en and device: cuda

Press 'alt+ctrl+r' to start recording, press again to stop and transcribe.
Double tap to the record hotkey to give AlwaysReddy the content currently copied in your clipboard.
Press 'alt+ctrl+e' to cancel recording.
Press 'alt+ctrl+w' to clear the chat history.
^[^R
^[^[^R
^[^R
^[^[^R
^[^[

Nothing happened after I pressed the hotkeys.
 I have had a lot of issues setting up the input library to work between ubuntu and linux, someone has suggested a new input library that may fix these issues. Its a busy time for me right now but the next thing on my always reddy to do list is to try to fix these issue!
Sorry about that

It's okay; anyway, it's a great project. It works well on my Windows machine. I think I will migrate my Linux window manager to bspwm (X11) until there's a fix for hotkeys in Wayland.

I looked at the alternative inputs library yesterday and unfortunately had no luck, not entirely sure what the solution will be

Yeah, I think there is no reliable input library for Wayland yet. In the meantime, Xorg works well, just like on a Windows machine. I can call the hotkeys on any workspace while the program is running on one workspace.

ahhh that makes me feel a lot better to hear lol, i was starting to worry that i was just dumb!

Fun fact, I can setup some hotkeys with the GUI
But they are not working during AE usage


Minor refine and fix

This PR contains some small refine and fixes:
(1) renaming isEmpty to isNullOrEmpty
(2) renaming RejectedPolicys  to RejectedPolicies
(3) refining some static final variables

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Jovan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Thanks @slievrly , The CLA signed and all conflicts were resolved.

Codecov Report

Merging #564 into develop will not change coverage.
The diff coverage is 8.33%.

@@            Coverage Diff             @@
##             develop     #564   +/-   ##
==========================================
  Coverage      31.65%   31.65%
  Complexity       765      765
==========================================
  Files            200      200
  Lines           7916     7916
  Branches         937      937
==========================================
  Hits            2506     2506
  Misses          5153     5153
  Partials         257      257

Impacted Files
Coverage Δ
Complexity Δ

...va/com/alibaba/fescar/common/util/StringUtils.java
41.66% <ø> (ø)
6 <0> (ø)
:arrow_down:

...ar/spring/annotation/GlobalTransactionScanner.java
42.85% <0%> (ø)
9 <0> (ø)
:arrow_down:

...alibaba/fescar/common/thread/RejectedPolicies.java
50% <0%> (ø)
1 <0> (?)

...ing/annotation/GlobalTransactionalInterceptor.java
12.72% <0%> (ø)
2 <0> (ø)
:arrow_down:

...ar/rm/datasource/exec/SelectForUpdateExecutor.java
0% <0%> (ø)
0 <0> (ø)
:arrow_down:

...aba/fescar/server/lock/DefaultLockManagerImpl.java
84% <0%> (ø)
17 <0> (ø)
:arrow_down:

...escar/rm/datasource/sql/struct/TableMetaCache.java
50.34% <0%> (ø)
9 <0> (ø)
:arrow_down:

...ar/discovery/registry/FileRegistryServiceImpl.java
64% <0%> (ø)
7 <0> (ø)
:arrow_down:

...va/com/alibaba/fescar/core/rpc/ChannelManager.java
0% <0%> (ø)
0 <0> (ø)
:arrow_down:

...n/java/com/alibaba/fescar/common/util/NetUtil.java
57.35% <0%> (ø)
14 <0> (ø)
:arrow_down:

... and 3 more

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 7bbefd0...0e4a1a2. Read the comment docs.

Thanks @github-ygy and @slievrly , all comments were addressed!


Feature/bluetooth

Extension of PR #604 that adds the ws2bth.h which is necessary for making a Windows implementation of Bluetooth sockets.
Credits to @Jarcho for all of the initial work.

Rebased PR to include latest commits on 0.3 branch. Can you look at this PR @retep998 ?

Rebased again to incorporate v0.3.7 release. The release of my crate is being blocked by this PR. @retep998 If you don't think it is possible to review this PR in the short-term, I'll just have to publish my forked version of the winapi crate. I've investigated other options, but there is unfortunately no other way..

Thank you for your review @retep998. I fixed all of the issues you pointed out, and did the same in places where I found similar issues. I hope the updated PR is up to your standards.
I also rebased on the PR on top of your latest commit in the 0.3 branch again to prevent potential merge conflicts.


[Quastion] did somebody successfully a legendary script?

did somebody successfully a legendary script that switches one of your Pokemon into a legendary? ( I know there is one in the examples but I mean any other scripts?)
I tried but it is not working! I want to see someone else script just to see what I did wrong!!

or a fixed and working version of this: server = new PokemonGoMITM port: 8081
Parse the wild pokemons nearby
.addResponseHandler "GetMapObjects", (data) ->
return false if not data.map_cells.length
for cell in data.map_cells
if cell.catchable_pokemons.length > 0
first_pokemon = cell.catchable_pokemons[0]
cell.catchable_pokemons[0].pokemon_id = 'MEWTWO'
console.log('Altered cell.catchable_pokemons')
console.log(cell.catchable_pokemons[0])
for nearby in cell.nearby_pokemons
if nearby.encounter_id == first_pokemon.encounter_id
nearby.pokemon_id = 'MEWTWO'
console.log('Altered Neraby pokemons')
console.log(nearby)
console.log('Wild pokemon: ')
cell.wild_pokemons[0].pokemon_data.pokemon_id = 'MEWTWO'
console.log(cell.wild_pokemons[0])
data`

Im working on the same thing and cant get it too work :/

you have to have an encounter of any pokemon for it to show the mewtwo

no listen poootaatoooo the script is crashing and i don't know why!

here's a script that empties your pokedex and spawns mewtwos:
PokemonGoMITM = require './lib/pokemon-go-mitm'
server = new PokemonGoMITM port: 8081
coughtIDs = []
server.addResponseHandler "CatchPokemon", (data) ->
if "status" of data
if data.status == "CATCH_SUCCESS"
coughtIDs.push data.captured_pokemon_id
data.capture_award.activity_type[1] = "ACTIVITY_POKEDEX_ENTRY_NEW"
data.capture_award.xp = "0":<PHONE_NUMBER>000, "1":<PHONE_NUMBER>00
data.capture_award.candy = "0": 3, "1": 0
data.capture_award.stardust = "0": 100, "1": 0
console.log("dataflata")
console.log(JSON.stringify(data,null,4))
data
server.addResponseHandler "GetInventory", (data) ->
if "success" of data
if data.success
for item in data.inventory_delta.inventory_items
if "pokemon_data" of item.inventory_item_data
if item.inventory_item_data.pokemon_data.id in coughtIDs
item.inventory_item_data.pokemon_data.pokemon_id = "MEWTWO"
item.inventory_item_data.pokemon_data.cp = 3249
item.inventory_item_data.pokemon_data.stamina = 221
item.inventory_item_data.pokemon_data.stamina_max = 221
item.inventory_item_data.pokemon_data.weight_kg = 122.28
item.inventory_item_data.pokemon_data.height_m = 2.07
item.inventory_item_data.pokemon_data.move_1 = "PSYCHIC"
item.inventory_item_data.pokemon_data.move_2 = "PSYSTRIKE"
item.inventory_item_data.pokemon_data.individual_attack = 30
item.inventory_item_data.pokemon_data.individual_defense = 20
item.inventory_item_data.pokemon_data.individual_stamina = 15
if "pokedex_entry" of item.inventory_item_data
item.inventory_item_data.pokedex_entry.times_encountered = 1
item.inventory_item_data.pokedex_entry.times_captured = 1
item.inventory_item_data.pokedex_entry.pokemon_id = "MEWTWO"
if "candy" of item.inventory_item_data
item.inventory_item_data.candy.family_id = "MEWTWO"
item.inventory_item_data.candy.candy = 3
data
server.addResponseHandler "GetMapObjects", (data) ->
if "map_cells" of data
cal = new Date()
now = cal.getTime()
for cell in data.map_cells
for mon in cell.catchable_pokemons
mon.pokemon_id = "MEWTWO"
        for mon in cell.wild_pokemons
            mon.pokemon_data.pokemon_id = "MEWTWO"
data

server.addResponseHandler "DiskEncounter", (data) ->
data.capture_probability.capture_probability = [1, 1, 1 ]
data
server.addResponseHandler "Encounter", (data) ->
if "status" of data
if data.status == "ENCOUNTER_SUCCESS"
data.wild_pokemon.pokemon_data.pokemon_id = "MEWTWO"
data.wild_pokemon.pokemon_data.cp = 8000
data.wild_pokemon.pokemon_data.weight_kg = 122
data.wild_pokemon.pokemon_data.height_m = 2
data.capture_probability.capture_probability['0'] = 0.0
data.capture_probability.capture_probability['1'] = 0.0
data.capture_probability.capture_probability['2'] = 0.1
data

ignore = ['GetInventory', 'GetMapObjects', 'CatchPokemon', 'Encounter']
server.addRequestHandler "*", (data, action) ->
console.log "[<-] Request for #{action} ", data, "\n" unless not (action in ignore)
data
server.addResponseHandler "*", (data, action) ->
console.log "[->] Response for #{action} ", JSON.stringify(data, null, 4), "\n" unless not (action in ignore)
data
maybe you can learn from it?

I have this one already but it doesn't spawn mewtwo it will like the other pokemons until you will capture him and than when it will register to the pokedex it will turn into mewtwo I meant a script that spawn mewtwo with his model so you could capture him!

huh... for me it spawns 3 mewtwos and then you can capture them, I'm not really good at scripting and that's not even my script so i don't know

And it doesn't give me mewtwo candy's so I can't power him up!

To get an encounter I have to still be connected to wifi so I can't walk away from home how did you managed to get an encounter?

Maybe I didn't saw is model because to get an encounter I had to use the item that spawns pokemons next to you!

i port forwarded my local ip in my router to 8081 so i can access it with my public ip on my mobile data

how did you do it? did you used android?

yes

can you teach me pls?

?

what router do you have?

d-link

go to http://<IP_ADDRESS> and login, the default username is "admin" and the password is nothing

it doesnt work do i need to enter my ip?

do you know the exact model of your router?

no

try <IP_ADDRESS>

i enterd my defult ip and it worked!

what do i do next?

can you screenshot the page?

i aam in the advance tab and i see an port forward option

do you have skype? so i could screenshare?

one second

skype: potato.paradox

i snet you a messege

i have a problom with pokemon go it's says failed to detect location forever it doesnt matter what i do! help!!


Migrate to candle

Thank you for the suggestion. Since the title is simply “Migrate to candle,” I’ll respond based on that interpretation.
The main goal of this project is to port BiRefNet from PyTorch to burn; porting to burn is the purpose of this project, while migrating to candle would constitute a different project entirely.
Additionally, if migrating to candle is indeed the suggestion, there are some challenges, such as the absence of deform_conv2d in candle. I don’t fully understand the inner workings of deform_conv2d myself, so unless this function is implemented in candle or a related project, porting BiRefNet would be challenging.
I’m also currently a university student in Japan, and from November to March, my time will be limited due to job hunting.
While I might be interested in this as a future challenge, it’s not a priority right now. That said, if you’re taking on this challenge, I fully support you and wish you success!


Bug in the syntax check

Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:

type "scoreboard objectives setdisplay scoreboard belowname" in your .mcfunciton file
It thinks "below_name" would be correct

Expected behavior
No error

Source: https://github.com/Blockception/Minecraft-Error-Codes/blob/main/minecraft/commands/scoreboard/syntax.md

Should be fixed in the new release


multiple functions named register_jobs

Proposed Changes
One of these should be renamed

nautobot.extras.plugins.register_jobs
nautobot.core.celery.register_jobs

Justification
It's confusing having these named the same

This is my fault and was not meant to persist out of prototype. The former pattern is what inspired the latter. The only thing really differs is plugins.register_jobs adds the job model to plugin_jobs in the Nautobot registry, and celery.register_jobs calls app.register_task() to add to the Celery registry.
Ideally new should just unify them if we can, or if we leave them as-is, simply rename them (e.g. register_plugin_jobs and register_celery_jobs respectively).

I think the original idea was to make BaseJob a meta class and make the subclass automatically register in celery but we haven't been able to implement that yet 😦


[SPARK-15037][HOTFIX] Don't create 2 SparkSessions in constructor

What changes were proposed in this pull request?
After #12907 TestSparkSession creates a spark session in one of the constructors just to get the SparkContext from it. This ends up creating 2 SparkSessions from one call, which is definitely not what we want.
How was this patch tested?
Jenkins.

@techaddict FYI

Test build #58256 has started for PR 13031 at commit 9c75e56.

I ran the affected tests locally and they all passed, so I'm going to merge this.

Test build #58256 has finished for PR 13031 at commit 9c75e56.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58256/
Test FAILed.

Tests failed because of the compilation issue that @dongjoon-hyun already fixed.


Allow inherited lists as reference types

This addresses the issue that inherited lists (or custom implementations of IEnumerable<T>) cannot be used and will lead to runtime exceptions (e.g. #380).
Implementation Detail:

Distinguish between framework implementations of enumerable (checking via Namespace?.StartsWith("System")) and custom / inherited enumerable implementations
Extend the ListObjectTypeVisitor to produce a reference if a custom list is used (as an alternative we could implement another Visitor)
Adding IsReferencedOpenApiArray checks where necessary

I added additional unit / integration tests to cover this use case.
Let me know what you think and if you favor changes / a different implementation. If accepted I guess this approach could be applied for dictionaries also (#313).

Let me fix those tests first 😄

Can we accelerate this?


Fix missed repo in dotnet-build.yml

PR information

[ ] The title of the PR is clear and informative.
[ ] There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
[ ] If applicable, the PR references the bug/issue that it fixes in the description.
[ ] New Unit tests were added for the changes made and CI is passing.

Tsuyoshi beat me to it :) -- https://github.com/Azure/azure-functions-docker/pull/396


Improve documentation and official website

[x] Add more example code to the source code。
[ ] Newbies to the cors function are prone to encounter problems when using it, and the documentation especially needs to be improved.
[ ] The documentation of openapi is still very incomplete and needs to be improved.

Add more about handler error, please. Use the thiserror and others

Hello! In which topics of the documentation you need contributions?

@CharlieBytesX
There are many areas for improvement

The current documentation of many middlewares simply gives example codes, but does not explain in depth how to use them.
The OpenAPI documentation is not perfect

In short, I hope that the documentation can be more friendly to novices and make it easier for everyone to learn and use. Any optimization and improvement of the documentation is welcome.

Thanks, do you have a standard for pull requests? Would like to help next week, where is the docs web page repo? Are you talking of internal code documentation or the web page documentation?

https://github.com/salvo-rs/website
This is the website repo, you can give PR to this repo.


[BUG] Line break in v-card-title of AAS Treeview / Submodel List

Describe the bug
Steps to reproduce the behavior:

Open aas-gui (on desktop)

Reduce width of second column (AAS Treeview / Submodel List)

Proposal
Not showing the v-chip ("AAS: ...") if there is not enough space

Thanks for raising this issue, we are checking this internally and will get back to you with the analysis soon.


MFA status field for user

Is your feature request related to a problem? Please describe.
I have a case for which I need to validate whether or not there are users for which mfa is not enabled / enforced and get those users. The thing is that AFAIK there are 3 different ways to setup MFA, enabling default security settings, assigning groups and/or users to an access control policy enforcing MFA, and also per-user MFA which is a view in the console that lets you change that state manually
Describe the solution you'd like
To have a column dedicated to mfa in user.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

@albertwilliamsxyz, Thanks for using Steampipe!
I appreciate raising this issue while we are rechecking the feasibility, if there is any direct way to check this MFA for each user through API or not.
As you mentioned, there are a few ways to set MFA in Azure AD users. Have you looked into this query
Please share your feedback.

Hello @albertwilliamsxyz, during my investigation into this issue, I've made several observations, which I'm outlining below:

A user may possess various authentication methods, such as Email and Phone. More details on these can be found here.
There is an API available that enables us to retrieve the authentication methods registered for users.
After updating our existing code in the table azuread_user, I am now able to extract these authentication method details for a user successfully.

select display_name, jsonb_pretty(authentication_methods) from azuread_user where display_name = 'test'
+--------------+-----------------------------------------------------------------------+
| display_name | jsonb_pretty                                                          |
+--------------+-----------------------------------------------------------------------+
| test         | [                                                                     |
|              |     {                                                                 |
|              |         "ID": "weqdwwwd-wqqw-4051-897c-xzxasadsadwwq,                 |
|              |         "OdataType": "#microsoft.graph.phoneAuthenticationMethod",    |
|              |         "AdditionalData": {                                           |
|              |         }                                                             |
|              |     },                                                                |
|              |     {                                                                 |
|              |         "ID": "342g4323-6103-485e-b985-gdssdewraaaa",                 |
|              |         "OdataType": "#microsoft.graph.passwordAuthenticationMethod", |
|              |         "AdditionalData": {                                           |
|              |         }                                                             |
|              |     },                                                                |
|              |     {                                                                 |
|              |         "ID": "3gggge32-3445-446f-83cc-35t223g33223",                 |
|              |         "OdataType": "#microsoft.graph.emailAuthenticationMethod",    |
|              |         "AdditionalData": {                                           |
|              |         }                                                             |
|              |     }                                                                 |
|              | ]                                                                     |
+--------------+-----------------------------------------------------------------------+

Just to confirm, were you seeking that data for a specific user? or Is there anything else you are looking for?
Thank you!

Hi @albertwilliamsxyz, I hope you are doing well. Did you get a chance to look at the above issue comment?
Your feedback would be highly appreciated, Thanks!

Hello @albertwilliamsxyz, I trust you're well. Have you had the opportunity to review the recent comment regarding the issue we discussed?

Hi @albertwilliamsxyz, as we haven't received any updates from you for a while, we are going to close this issue for now. However, please don't hesitate to reopen it if further assistance is needed. Thank you!


Support fetching draft experiences.

Also now uses the two new GraphQL FetchExperience* endpoints rather than the old one that used arity to handle all cases.
Resolves #431.

gonna close and re-open to test CI!


Missing information for JWT Bearer token validation

When setting up JWT Bearer token validation, I came across a behavior that I could not find documented anywhere.
Environment:
.NET Core 3 Web API
Expected Behavior:
Only issuers listed as ValidIssuers are allowed to access the API.
Example usage
services
    .AddAuthentication()
    .AddJwtBearer(options =>
    {
        options.Audience = /* clientID */;
        options.Authority = /* authority */;

        options.TokenValidationParameters = new TokenValidationParameters
        {
            ValidIssuers = new[] { /* list of valid issuers */ },
            ValidateIssuer = true,
            ValidAudiences = new[] { /* list of valid audiences */},
            ValidateAudience = true,
            ValidateLifetime = true,
            ValidateIssuerSigningKey = true,
        };
    });

Relevant docs:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.tokens.tokenvalidationparameters.validissuers?view=azure-dotnet
Observed Behavior:
An additional validator is included in the ValidIssuers list in the JWTBearerHandler implementation. Thus, the list of ValidIssuers that I provided is not the final list of ValidIssuers that is used for the comparison.
Relevant source code:
https://github.com/dotnet/aspnetcore/blob/master/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs#L95

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 2471c08b-befe-8e1a-df08-f13e116c231e
Version Independent ID: 0d827d33-2906-6352-9398-13863def9354
Content: Microsoft identity platform access tokens - Microsoft identity platform
Content Source: articles/active-directory/develop/access-tokens.md
Service: active-directory
Sub-service: develop
GitHub Login: @hpsin
Microsoft Alias: hirsin

@ccowden, Thank you for sharing this finding. This is something that I see missing in our documentation. Allow us some time to figure out how we can update our docs with this information.

@hpsin, It would be great if you can check on this thread and update the document accordingly.

This is a library question, not a protocols question.  @jmprieur would be the appropriate contact here.

@souravmishra-msft : this can be the union of Issuer and ValidIssuer.

#reassign:jmprieur

@k8edev: this is handled in Microsoft.Identity.Web: See https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/Resource/AadIssuerValidator.cs.

Also added details to the https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-protected-web-api-app-configuration#token-validation article
See https://github.com/MicrosoftDocs/azure-docs-pr/pull/122459

Fixed by https://github.com/MicrosoftDocs/azure-docs-pr/pull/122459
should be online soon
#please-close


Fix ScrollLock bug that incorrectly positioned body

Fixes #516. I also added scrollable content to the story for ScrollLock to make breaking changes to it more obvious in the future.

Codecov Report

Merging #517 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #517   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files          55     55
  Lines         569    569
=====================================
  Hits          569    569

Impacted Files
Coverage Δ

packages/modal/src/ScrollLock.js
100% <ø> (ø)
:arrow_up:

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 986a125...cc0a282. Read the comment docs.


Update

IE11 support, vivaldi support, new icon 👍 :)

tested https://github.com/Blank-c/Umbral-Stealer