Tap outside to close

Is there a way to implement that function? Right now when I tap on the darkened region, the modal doesn't close.

Hey!
It should be possible by toying a bit with the touchable options of this View.
Would you mind giving it a try and submitting a PR?
Otherwise I'll take a look at it in my spare time :)

😆 pls add this function~~ thanks

Thank you @mmazzarolo , actually I fixed using exactly same method you mentioned. It works, but since the first image in your preview images (on README.md) does it correctly, I thought it was implemented already, wasn't it?

@Doko-Demo-Doa according to the source code, haven't implemented yet, there is no close event on backdrop view or you can do sth like this, not so good but should be work.
<TouchableWithoutFeedback onPress={() => this.setState({ visible: false })}>
        <Modal isVisible={this.state.visible}  ...>
            <TouchableWithoutFeedback onPress={() => {}}>
                    ... your custom view
            </TouchableWithoutFeedback
       </Modal>
</TouchableWithoutFeedback>

@Doko-Demo-Doa oh wow, honestly I don't remember how I implemented it for that screenshot (I did it in a customized version of this lib 😞 ).
@DavidKongDesheng the problem with that solution is that clicking everywhere on the modal will close it.
In my opinion the right solution would be using onStartShouldSetResponderCapture (or something similar in the right place.
The perfect solution would be that:

The backdrop should respond to the user touch (end by default trigger onClose or onBackdropPress);
The view content should not respond to the backdrop touch, of course;
The view content can have another independent button/touchable component inside.

What do you think guys?
Also, thank you @Doko-Demo-Doa and @DavidKongDesheng for the discussion, any feedback is of course warmly welcomed! 😸

I played a bit.
It seems that the right way to handle it is by applying something like this: `
onStartShouldSetResponder={() => {
  console.log('You pressed the backdrop!');
  return true;
}}

in the backdrop view.
The problem with this approach is that it won't work correctly if you're centering the modal content using this:
content: {
    flex: 1,
    justifyContent: 'center'
  }

...which is the default style applied to the content.
I guess we should wait until react-native 0.43 stable lands and try changing that style to the new margin: auto, which I hope will make the backdrop press work correctly.
I'm obviously open to discussions on the matter :)

@mmazzarolo On my solution I added two touch events, one for Modal itself which will close the modal, the other one is on the Modal content view which will do nothing 😸,  so only when you click the backdrop will close the modal.
<TouchableWithoutFeedback onPress={() => this.setState({ visible: false })}>
<Modal isVisible={this.state.visible}  ...>
<TouchableWithoutFeedback onPress={() => {}}>
... your custom view
</TouchableWithoutFeedback

Yup, the right solution should be make the backdrop respond to user touch.

Oh, nice! @DavidKongDesheng did you test your solution?
Do you think it works correctly in most cases?

Thanks!

@mmazzarolo Just added touch event to your example code, you can download and try,  but this is not the best way to implement.
app.js.zip

It seems that RN's modal component is pretty meh. If there's something like Dialog on Android or UIAlertView on iOS, it would be much better in this case :(

Hi,
I did exactly the same thing as @DavidKongDesheng but still don't working on my side !
<TouchableWithoutFeedback onPress={() => this.setState({ modalVisible: false })}>
  <Modal transparent={true} ref="modal" visible={this.state.modalVisible} onRequestClose={this.close.bind(this)} animationType={this.state.animationType}>
    {this.renderOptionList()}
  </Modal>
</TouchableWithoutFeedback>

Or maybe i don't make it well... no ?

Hi! For me the solution of @DavidKongDesheng works great 🔥
This is my code:
`constructor(props) {
super(props);
this.state = {
isModalVisible: false
}
}
_showModal() {
this.setState({ isModalVisible: true })
}
_hideModal() {
this.setState({ isModalVisible: false })
}
render() {
const { alerts, showAlert } = this.props;
return (

    <TouchableWithoutFeedback onPress={() => this._hideModal() }>
      <Modal style={{margin: 0}} isVisible={this.state.isModalVisible}>
        <AccountModal />
      </Modal>
    </TouchableWithoutFeedback>

    ....`

Hope to be helpfull!

@emaLorenzo Thanks! But it doesn't work :(
I don't know why it doesn't triggered the background :/

@warka0 Can't reproduce it according the attached codes, but it looks like you are using Modal from 'react-native' not from 'react-native-modal'
Or maybe try

Remove onRequestClose, use onBackButtonPress instead
Set transparent={false}  and set 'red' as background color of your option list view, and check if really click on the background or somewhere else.
Check your renderOptionList().

Or more codes attach...

@emaLorenzo Thanks for your solution, this worked for me 👏  👍

@DavidKongDesheng Your solution worked for me, thanks! I hope this functionality is added soon to react-native-modal, it's such an important function.

I'll test it in two days. Cannot do it right now, i'm between two airports. :p

Hey, I'll try to take a look at it soon (PRs are obviously warmly welcome) :)
I still haven't tried the touchable wrapper but... doesn't it swallow the click buttons inside the modal (if any)? 🤔

Ok, i've tried and it's working, thanks!

@warka0, does it also work if you add a button inside the modal? Doesn't the TouchableWithoutFeedback wrapper on the modal swallow any touch to components inside it?

@mmazzarolo So the modal is wrapped in TouchableWithoutFeedback but inside the modal I have a bunch of buttons wrapped around in TouchableOpacity and it works perfectly 👍

It was easier than I thought then :) Anyone willing to submit a PR?

Sure I'll submit an example

@jm90m thank you for the PRs!
However...
Guys, with @emaLorenzo 's solution the modal is closed wherever you tap, while the issue was focused on closing the modal only when clicking on the backdrop 😿

@mmazzarolo ohh, yeah looks like the main issue is more complex than it seems. I see, if I ever come across a solution, I'll submit a PR if no one has done so yet.

You guys can take a look at my (repo)[https://github.com/zhantx/react-native-flex-modal], the idea is surround modal with 4 touchables. My initial solution was use a screen size touchable to perform tapToClose, a modal size touchable wrapping the modal to prevent the tap event gose up(no onpress). But then I found I can't use scrollview inside the touchable. So I came with up the solution in my repo

And also, by adjusting the flex value of the four touchables, we can change the position of the modal, which also solve #22 , I already used my modal to create a popover

Hey @zhantx , thank you for contributing to the discussion 👍
Glad there's someone else out there working with the modals.
It seems you're solution is super-flexible, at the cost of being a bit more harder to grasp to someone new to RN.
For this repo I'd like to keep the things as simple as possible, but your solution might be a good source of info for future implementations.
Also, I only took a quick look at your code, can the modal be showed without setting all the dimensions (for example: can it adapt itself to a flex content)?
P.S.: PRs ans support are super welcome here if you're interested :)

Hey @mmazzarolo , yeah I've been trying hard to simplify my modal by setting default props. so if none props are set then it will be at the center of the screen.
For you modal, to be honest adding tapToClose is impossible cuz your modal is controlled by prop isVisible, so the modal can't close itself directly. What I suggest is implement four touchables in your modal, and trigger an onTapBackdrop callback to let parent component to change the isVisible

Hey @zhantx, thanks!

so if none props are set then it will be at the center of the screen.

Does it also resize itself based on the content size? 🤔

For you modal, to be honest adding tapToClose is impossible cuz your modal is controlled only by prop isVisible, so the modal can't close itself directly

I'm not aiming at making the modal close itself directly, just to exposing an onBackdropPress listener, which can be used to close it from the modal's parent.

(that's the reason why I choose ref methods open() and close())

I'm trying to keep react-native-modal component as controlled as possible by staying away from refs method (at least until they're really needed).

@mmazzarolo , check this out

@zhantx this is super-cool, thanks!
I'll take a look at a way to implement a similar solution here as soon as I have some free time.
Obviously, backward-compatible PRs are welcome too.

@mmazzarolo you are welcome mate, glad to be helpful.
my modal is just a side product of my work, may don't have time to contribute yours
anyway, best wishes to remaining works, cheers

Dont understand the Modal is taking the full screen for the backdrop overlay. So the solution doesnt work to wrap it inside a Touchable

@zhantx  very helpful thx. For my case, I only had to use 2 TouchableWithoutFeedback (One for wrapping around the entire Modal and another for wrapping around the modal content):

as long as you don't have scrollview within modal:)

@zhantx nope its a simple menu, but good point :)

This worked for me, edit the index.js to add a PanResponder:
componentWillMount() {

    ......

        // for the backdrop touch to close
        this._panResponder = PanResponder.create({
            // Ask to be the responder:
            onStartShouldSetPanResponder: (evt, gestureState) => true,
            onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
            onMoveShouldSetPanResponder: (evt, gestureState) => true,
            onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,

            onPanResponderGrant: (evt, gestureState) => {
            },
            onPanResponderMove: (evt, gestureState) => {
            },
            onPanResponderTerminationRequest: (evt, gestureState) => true,
            onPanResponderRelease: (evt, gestureState) => {

                // close the modal
                this._close();
            },
            onPanResponderTerminate: (evt, gestureState) => {
            },
            onShouldBlockNativeResponder: (evt, gestureState) => {
                return true;
            },
        });
}

render() {
        ........
        <View
                    {...this._panResponder.panHandlers}
                    onLayout={this._handleLayout}
                    ref={ref => (this.backdropRef = ref)}
                    style={[
                        styles.backdrop,
                        {backgroundColor: backdropColor, width: deviceWidth, height: deviceHeight},
                    ]}
                />
        ........
}

Hey @hellomaya , thank you for sharing your snippet.
How does it handle buttons inside the modal? Doesn't the panresponder swallow the press on them?

@hellomaya's solution seems to work only if we click the backdrop shadow placed at the horizontal margins. For instance, if I click above or below the Modal, onPanResponderRelease doesn't get triggered (I'm testing it with the official example on Android)

Hi, @mmazzarolo thanks for your asking and @jkomyno thanks for your test.
Sorry I have been busy working on something, my test initially is in my own project, and it's working well in both iOS simulator and Android device, I didn't see the issue you guys mentioned.
But to avoid the panresponder swallow issue, you will have to put all buttons in a separate component, like this:
<Modal ....>
   <Content />
</Modal>

....
class Content extends Component {

    ......
    return (<View><Button onPress=.....></Button></View>)

In the official example, it do have an issue like @jkomyno mentioned, the issue is because the default content style had flex: 1, so there is no room for backdrop, check index.style.js file.

That's right, but using flex: 1 is the only way to have the modal size resize itself based on its content (obviously, I'll be glad to be proven wrong).

Yes, it doesn't matter indeed, try add some margin around the content view, still be able to close the modal by tap outside. marginVertical: 25 for example, larger than 20 was recommended to avoid invalid tap at top in iOS.
<Modal style={marginVertical: 25...>

Hi there, I've just found some great solution (I do not know if someone has already found it).
I add two touchable and text elements within my component and I link to them my onPress event (and its relative closing modal window method).
Here is at my screen looks like:

the blue borders can hide the modal on Press;
the select button takes the selected day (or period), save it into a state and close the modal window.

Below is the snippet of my code:
        <Modal
          isVisible={this.props.isVisible}
          backdropOpacity={.9} backdropColor={'#2B333D'} animationIn={'slideInDown'} animationOut={'slideOutUp'}
          style={Styles.modalContainer}
        >
            <TouchableWithoutFeedback
              onPress={() => this.props.hideModal()}
            >
              <Text style={{ backgroundColor: 'blue', height: 100, width: 350 }}> </Text>
            </TouchableWithoutFeedback>
          <View
            style={Styles.viewContainer}
          >
            {this.showPicker(this.props.metricFormat)}
            {this.showWeekSelection()}
            <TouchableOpacity
              onPress={() => {
                this.props.hideModal();
                this.props.onSelectDay(this.state.selectedStartDate, this.state.selectedEndDate);
              }}
              style={Styles.buttonContainer}
            >
              <Text
                style={Styles.text}
              >
                {I18n.t('select')}
              </Text>
            </TouchableOpacity>
          </View>
            <TouchableWithoutFeedback onPress={() => this.props.hideModal()} >
              <Text style={{ backgroundColor: 'blue', height: 100, width: 350 }}> </Text>
            </TouchableWithoutFeedback>
        </Modal>

Hey @tdimnet, thank you for contributing.
The pattern you're following mimics the one showed by @zhantx (he uses 4 touchables in his solution).
I'm stil not 100% sure on adding a similar solution to react-native-modal though, because I'm worried it might be a bit to complex to tweak later on (and might be a bit hard to configure for the users without adding a ton of props).
What do you think?

Well, this is a really though question :).
I have been through this problem during this afternoon and I think this is maybe the most graceful solution for now. It lets you hide or show the modal window as you would need.
However I think you're right: adding this to your package could make the project more complex to custom and harder to understand and it really depends on the situation you are dealing with.
On my case I was looking for several ways to close the modal window:

the first one by selecting a data within my calendar picker.
the second one by simply close the window by tapping outside of it.

That being said I think we could simply update the readme file in order to other people have a better understanding and a good grasp of how to solve this common problem.
If you want, I can open a PR this week which updates the readme file and presents this solution.

Thank you for your quick reply, I would be grateful for a PR on the README :)
Thanks!

There is an easy solution for closing the modal in react native for IOS: Define a TouchableOpacity inside the Modal.
`             <Modal animationType={"slide"}
transparent={true}
visible={this.state.visibleModal}>
<TouchableOpacity onPress = {() => {this.setState({visibleModal: false})} }>
                  <View style={styles.modalContent}>
                      <Row />
                  </View>

              </TouchableOpacity>

        </Modal>`

Guys, my PR should fix it without too much changes.
You can also still make other handlers to e.g. buttons inside the modal.

Hi @RichardLindhout , thank you for the PR, I'll paste here what I already wrote in the PR thread:

I took a close look at it and it seems that the idea of the touchable wrapper + the custom pointerEvents still won't work if you tap on the side of the modal content, am I right?

If you press the black it will close. The modal itself will not receive touch events but the children will.
See https://facebook.github.io/react-native/docs/view.html#pointerevents
So I can still have other handlers for my 'OK' button or select text inside the modal. (or date pickers for instance will still work)

@RichardLindhout I'm so happy to say that I was wrong, I fired up the emulator and it seems to be working perfectly so far!
It's super weird, because I tried an identical solution to the one you proposed when this issue was opened and it didn't work.
I guess this might be related to an update of React-Native, because I guess even @zhantx did try a similar solution in the past.
Thank you @RichardLindhout  for sending the PR, anyone else willing to test it?
I'll gladly merge it once someone else other than me and @RichardLindhout give it a try and can confirm that it works and doesn't break anything.
One last thing @RichardLindhout, may I suggest renaming hideOnBackdrop to hideOnBackdropPress?

@mmazzarolo Thank you, I will rename the variable.
Anyways below is a GIF which I made a few minutes ago to prove that it worked :)

@RichardLindhout No worries, I tried it with the example repo and it works indeed.
I just need a bit of testing from someone else too, because this modal is used in many different ways and I'd like to know if this feature will break anything.
Also, one last thing, for maintaining backward compatibility I think it would be better making hideOnBackdropPress default to false, what do you think?

Yes I agree, I also did not tested on Android yet.

I've just tested this on Android, and it doesn't quite seem to work. Tapping to the left or right will sometimes close the modal, but above and below have no effect.
I'll have a look at what's causing the issue later on - hopefully, today if I get time.

@ifiokjr, thank you, I suspect that the modal content being defined as "flex" might be the root cause of the issue.
I still do not understand why it works on iOS though... Maybe it is something we should report and discuss on the react-native official repo too.
Also, @ifiokjr, what version of react-native are you using?

@mmazzarolo I'm using 0.46.4.

use onPanResponderGrant for check your position tap.
You can use event.nativeEvent.locationY compare with pageY and set visible for modal.

Tapping outside to close works fine in the example from the repo (git clone...; react-native run-ios). However, whenever I try to replicate that behaviour in my own code, it never works. Is there something special in the example code?

Looks like I was able to solve it by using git repo (yarn add git-url) as opposed to npm (yarn add react-native-modal).

@dark1991 do you mind providing an example repo/snippet/PR?

@mmazzarolo : Check this link first: https://facebook.github.io/react-native/docs/panresponder.html.
focus on locationX, locationY, PageX and PageY.
You can use console for log to see position you are tap on model view.
onPanResponderGrant: (evt, gestureState) => {
       if(event.nativeEvent.locationY !==event.nativeEvent.pageY){
this.setState({visible:false})
}
      },

For more information, check here: https://www.youtube.com/watch?v=HzpuBZK3Ef0

@dark1991, did you already try it with a flex: 1 view as a child?
I'm asking this because me and some other users tried playing with it when the thread was stil new and it had some issue (especially on Android).
I can give it another try though 👍

@mmazzarolo, the problem is that when you create a layout-only view (one that only has other content and doesn't need to be explicitly rendered) and then change it to a non-layout-only view, it resets its pointerEvents to 'auto' (the default) on android. The animated.view library changes it to a non-layout-only view because CSS transforms are non-layout-only properties.
Long term fix (and further details) here: https://github.com/facebook/react-native/pull/15529
The short term fix is to add a property to the modal such that it is non-layout-only from the beginning: https://github.com/react-native-community/react-native-modal/pull/57

@tomasreimers that's great!
Unfortunately I'm not able to give it a test on Android yet (I'm still on vacation), anyone else willing to give it a try? @alexkuc @ifiokjr @RichardLindhout

Released on npm on 3.0.0, I'll add the release notes this evening.
Anyone willing to give it a try?

The release notes of v3.0.0 are here.
I already submit two other fixes (we're now on v3.0.2) and we should be stable now, any other test will be super appreciated.
Thanks to anyone who contributed on this issue!

I am going to give it a shot shortly. Just wanted to clarify that I use the setup properly. Previously, I was wrapping inside of Modal with <TouchableWithoutFeedback>. With #11 being fixed, does it mean I no longer need to use <TouchableWithoutFeedback>?

@alexkuc, yep, just set the visibility of the modal to false in the onBackdropPress callback :)

Yesssssss
Since the issue is solved. I think it can be closed now.

It took so long but we did it!  🎈
Feel free to open another issue if needed.

@mmazzarolo , I mean the bug was literally in compiler (or interpreter in this case): the optimizer of React Native's Java's ShadowNode tree. I think it's fair this one took a while to solve lol 😂
Now just to get react-native to accept their fix so we can remove our hacky fix. If you want to jump on and +1 the fix or add context, that would be much appreciated: https://github.com/facebook/react-native/pull/15529

Hi I'm still having this issue.
_hideModal = () => {       this.setState({ isModalVisible: false })   }
Passed a function as prop to a custom component <ModalBox />
onPress={this._hideModal}
In <ModalBox />
<Modal        isVisible={this.props.isModalVisible}             onBackdropPress={this.props.onPress}       >
It wont close after tapping on the backdrop. But when i use it in  <Button /> inside the modal, it works.
"react-native": "0.44.2",
"react-native-modal": "3.1.1",

Are you using Expo by any mean?
Could you try updating react-native?

@mmazzarolo
Nope, i'm not using Expo.
Btw, the problem solved. The react-native-modal package didnt update properly. My bad.
Thanks for the quick response.

Hi Guys
I tried the above suggestions but they dont work for me
When I click outside the modal my _hideModal() is not fired.
I am using RN 0.47.2 and react-native-modal 3.0.2
import React, { Component } from 'react'
import {StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native'
import Modal from 'react-native-modal'
class ConfirmSchedule extends Component {
constructor(props) {
super(props);
}
_hideModal() {
alert('hideModal')
}
render () {
return (
<TouchableWithoutFeedback onPress={() => this._hideModal() }>

Some text

)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
modalContent: {
backgroundColor: 'white',
padding: 22,
borderRadius: 4,
borderColor: 'rgba(0, 0, 0, 0.1)',
},
bottomModal: {
margin: 20,
},
})
module.exports = ConfirmSchedule;

That works greats for me, only use one layer behind options.
u have to make touchable the content of modal, not the modal per se.
                <View>
                    <Modal
                        animationType="slide"
                        transparent={true}
                        visible={this.state.modalVisible}
                        onRequestClose={() => {
                            this.closeModal();
                        }}>
                        <TouchableWithoutFeedback //this touchable close modal
                                onPress={() => {
                                    this.closeModal();
                                }}>
                            <View style={{flex:2,backgroundColor:'#6666669c'}}>//layer behind modal options
                                {this.renderOptionList()}
                            </View>
                        </TouchableWithoutFeedback>
                    </Modal>
                </View>

Hi guys,
I just found this issue and tried hard to read all of your comments and suggestions.
Here is what I've tried

Adding onBackDropPress(() => {this.props.hideModal()})
Adding TouchableWithoutFeedback inside and outside of components
other approaches...

Here is my the screen where I want to show my modal.
render() {
return (
<View style={{flex: 1}}>
        <ScrollView>
          // CONTENT HERE
          {this._renderModal()} //rendering modal here
          <FABs onFABsPress={this._showModal} /> // I open Modal when I press the FABs button
        </ScrollView>
      </View>));

_renderModal = () => {
    return (
      <CameraImageSelectModal
        hideModal={this._hideModal}
        isModalVisible={this.state.isModalVisible}
        navigation={this.props.navigation}
      />
    )
  }

Here is modal component : CameraImageSelectModal.js
  render() {
    let { isModalVisible } = this.props;
    return (
      <View>
        <Modal
          isVisible={isModalVisible}
          hideOnBackdropPress={false}
          transparent={true}>
          <View style={styles.modalContainer}>
            <View style={styles.modalTitleTextContainer}>
              <Text style={styles.modalTitleText}>Hello World</Text>
            </View>
            <View style={styles.modalContentTextContainer}>
              <Text style={styles.modalContentText}></Text>
            </View>
            <View style={styles.modalButtonContainer}>
              <Button transparent onPress={this._handleCameraPress}>
                <Text style={[styles.modalText, styles.black]}>Camera</Text>
              </Button>
              <Button transparent onPress={this._handleAlbumPress}>
                <Text style={styles.modalText}>Album</Text>
              </Button>
            </View>
          </View>
        </Modal>
      </View>

Thanks!!

Nevermind. I just updated the react-native-modal to the newer version and it solved my problem. Thanks!!
(I was using 2.5.0 version lol)

@jbaek7023  onBackdropPress works for u?

@Doko-Demo-Doa according to the source code, haven't implemented yet, there is no close event on backdrop view or you can do sth like this, not so good but should be work.
<TouchableWithoutFeedback onPress={() => this.setState({ visible: false })}>
        <Modal isVisible={this.state.visible}  ...>
            <TouchableWithoutFeedback onPress={() => {}}>
                    ... your custom view
            </TouchableWithoutFeedback
       </Modal>
</TouchableWithoutFeedback>

What if there is scrollView inside?

@Doko-Demo-Doa according to the source code, haven't implemented yet, there is no close event on backdrop view or you can do sth like this, not so good but should be work.
<TouchableWithoutFeedback onPress={() => this.setState({ visible: false })}>
        <Modal isVisible={this.state.visible}  ...>
            <TouchableWithoutFeedback onPress={() => {}}>
                    ... your custom view
            </TouchableWithoutFeedback
       </Modal>
</TouchableWithoutFeedback>

What if there is scrollView inside?

I think this solution would help you.
https://stackoverflow.com/a/40483972/4994493

I implements using @DavidKongDesheng 's solution.
export function MyModal(props) {
  const {modalVisible = false, onClose, children, preset = 'nonClose'} = props;

  return preset === 'nonClose' ? (
    <Modal animationType="fade" transparent={true} visible={modalVisible}>
      <View style={containerStyle.centeredView}>
        <View style={containerStyle.modalView}>{children}</View>
      </View>
    </Modal>
  ) : (
    <Modal animationType="fade" transparent={true} visible={modalVisible}>
      <TouchableWithoutFeedback onPress={onClose}> // when trigger click modal outside
        <View style={containerStyle.centeredView}>
          <TouchableWithoutFeedback onPress={() => {}}> // prevent trigger onClose when click modal inside
            <View style={containerStyle.modalView}>{children}</View>
          </TouchableWithoutFeedback>
        </View>
      </TouchableWithoutFeedback>
    </Modal>
  );
}

THIS WILL WORK 100%
<Modal
animationType="fade"
transparent={true}
visible={visible}
onRequestClose={() => {
Alert.alert("Modal has been closed.");
}}
>
// MODAL WHOLE VIEW
  ---------------------------
  |                                           |
  |       __________________       |
  |       |   //DATA             |      |
  |       |   Nam  JUNAID |      |
  |       |_________________|      |
  |                                           |
  |                                           |
  |___________________________|

    <TouchableOpacity
    onPress={() => closeModel()}
      style={{
        height: windowHeight,
        width: windowWidth,
        justifyContent: "center",
        alignItems: "center",
      }}
    >
// DATA THAT WILL SHOW IN MODAL

<View
style={{
height: windowHeight / 1.5,
backgroundColor: "pink",
borderRadius: 10,
width: windowWidth / 1.1,
}}
>  DATA GOES HERE IN THE CENTER

By clicking anywhere on an empty space modal will dismiss.

@Doko-Demo-Doa according to the source code, haven't implemented yet, there is no close event on backdrop view or you can do sth like this, not so good but should be work.
<TouchableWithoutFeedback onPress={() => this.setState({ visible: false })}>
        <Modal isVisible={this.state.visible}  ...>
            <TouchableWithoutFeedback onPress={() => {}}>
                    ... your custom view
            </TouchableWithoutFeedback
       </Modal>
</TouchableWithoutFeedback>

It's working.

Hi! I've tried most of the aproaches above and any of them seemed to solve the main issue. The last ones works but are half incomplete and difficult to understand, so I leave you here an updated easy to read component that solves the issue.
The code 👇👇👇

export const ModalScreen = () => {
  const [isVisible, setIsVisible] = useState(false);

  const showModal = () => {
    setIsVisible(true);
  };

  const hideModal = () => {
    setIsVisible(false);
  };

  return (
    <View style={styles.screenContainer}>
      <Button title="Open Modal" onPress={showModal} />

      <Modal visible={isVisible} transparent>
        <Pressable onPress={hideModal} style={styles.modalContainer}>
          <TouchableWithoutFeedback>
            <View style={styles.modalContent}>
              <Text>Modal Title</Text>
              <Button title="Close Modal" onPress={hideModal} />
            </View>
          </TouchableWithoutFeedback>
        </Pressable>
      </Modal>
    </View>
  );
};

const styles = StyleSheet.create({
  screenContainer: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  modalContainer: {
    flex: 1,
    backgroundColor: 'rgba(0,0,0,0.3)',
    justifyContent: 'center',
    alignItems: 'center',
  },
  modalContent: {
    backgroundColor: 'white',
    borderRadius: 10,
    padding: 40,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

Hi! I've tried most of the aproaches above and any of them seemed to solve the main issue. The last ones works but are half incomplete and difficult to understand, so I leave you here an updated easy to read component that solves the issue.

Works great!  Thanks!


Containerd Not Redirecting to the set Mirror Specified in Config.toml

Description
I am attempting to redirect all Docker Hub requests to my Nexus repository via the containerd configuration. Despite setting up the config.toml file correctly to point to my Nexus repository, containerd is not redirecting Docker Hub requests to the Nexus repository as expected.
Steps to reproduce the issue

Set the local mirror in the config.toml file:

[plugins."io.containerd.grpc.v1.cri".registry]
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
      endpoint = ["192.X.X.50:8XXX"]

Restart containerd to apply the changes: sudo systemctl restart containerd
Attempt to pull an image from Docker Hub using ctr: ctr images pull docker.io/node:latest

Describe the results you received and expected
The pull operation should have been redirected to the local mirror at 192.X.X.50:8XXX as per the configuration. Instead, the operation attempts to pull directly from Docker Hub and fails with the following error:
INFO[0000] trying next host                              error="failed to authorize: failed to fetch anonymous token: unexpected status: 400 Bad Request" host=registry-1.docker.io
ctr: failed to resolve reference "docker.io/node:latest": failed to authorize: failed to fetch anonymous token: unexpected status: 400 Bad Request

What version of containerd are you using?
containerd containerd.io 1.6.21 3dce8eb055cbb6872793272b4f20ed16117344f8
Any other relevant information
[root@worker1 ~]# runc --version
runc version 1.1.7
commit: v1.1.7-0-g860f061
spec: 1.0.2-dev
go: go1.19.9
libseccomp: 2.5.2
[root@worker1 ~]#  crictl info
WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
E0619 15:01:45.103749 2445335 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory""
FATA[0000] getting status of runtime: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory"
[root@worker1 ~]# uname -a
Linux worker1 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux
Show configuration if it is related to CRI plugin.
[root@worker1 ~]#  cat /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".registry]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["192.X.X.50:8XXX"]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."repo.labo.io:8083"]
endpoint = ["http://repo.labo.io:8083"]

ctr images pull docker.io/node:latest

ctr is not a CRI application, so you can't use ctr for testing "io.containerd.grpc.v1.cri" configs.
You may want to use crictl (https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md), or just test it with Kubernetes directly.


FIX: add missing item type 'PlaylistsFolder'

Only tested on Jellyfin Version: 10.7.5
When you have at least 1 playlist it creates a top-level folder for all playlists with a type of PlaylistsFolder.
The output of item dump for the playlist folder
{
  "Name": "Playlists",
  "ServerId": "f7df75e0e00d4ba887b85d79f0a4fd3c",
  "Id": "1071671e7bffa0532e930debee501d2e",
  "ChannelId": "None",
  "IsFolder": true,
  "Type": "PlaylistsFolder",
  "UserData": {
    "PlaybackPositionTicks": 0,
    "PlayCount": 0,
    "IsFavorite": false,
    "Played": false,
    "Key": "1071671e-7bff-a053-2e93-0debee501d2e"
  },
  "CollectionType": "playlists",
  "ImageTags": {},
  "BackdropImageTags": [],
  "ImageBlurHashes": {},
  "LocationType": "FileSystem"
}

Thanks!


Database fails to load in the browser

After capture, I am trying to load the database in the browser by pointing to <IP_ADDRESS>:1080.
Here's what I get
lost of lines like this
2017/09/08 16:01:06 Failed to save to database: unable to open database file
2017/09/08 16:01:06 Failed to save to database: unable to open database file
followed by lots of lines like
2017/09/08 16:01:07 http: Accept error: accept tcp [::]:1080: accept4: too many open files; retrying in 640ms
2017/09/08 16:01:07 http: Accept error: accept tcp [::]:1080: accept4: too many open files; retrying in 1s
I am running hyperfox on ubuntu linux

Hello @nitinsane,
Does this happen after some time or is immediate after starting-up?

I also have problems like @nitinsane . When start hyperfox and visit <IP_ADDRESS>:1080, i'm test on centos 7


[BUG] - Ubuntu links in release notes don't have latest files

Describe the bug
When you open up the links in the release notes for the Ubuntu Developer Set-up, none of the files for the latest release are there.  This includes the runtime, the SDK, and the container image for onebox.
Area/Component:
Release notes file:
https://github.com/microsoft/service-fabric/blob/master/release_notes/Service_Fabric_ReleaseNotes_91CU3.md
Links from release notes:
https://apt-mo.trafficmanager.net/repos/servicefabric/pool/main/s/servicefabric
https://apt-mo.trafficmanager.net/repos/servicefabric/pool/main/s/servicefabricsdkcommon/
https://hub.docker.com/r/microsoft/service-fabric-onebox/
Expected behavior
Files for the release should be found at the links above.

Assignees: /cc @microsoft/service-fabric-triage

Still true for the 10.0 release. Hard to see how Microsoft has any commitment to Java on Service Fabric considering the state they've left it in.


Fix error with return parameter and improvement of the apidoc

Hi @fedevergara
only couple of issue with flake.


[media_kit v1.1.10] Player .add() doesn't accept paths with spaces in them

Howdy all,
calling _player.add() on files with spaces in its path causes the loadfile command to error out
to resolve issue, used existing _command(...) function and it seems to be working

other functions in this file use mpv_command_string as well but none involve user-inputted strings

not sure if this info is also something that might be useful in other files too

native/player/real.dart
Old

New

Just throwing it out there -- might be a minor security risk given a malicious file path
Given path/example/example; execute cmd here.mp4, the following is output

Using _command() doesn't seem to have this issue, the semicolon doesn't escape the command

May or may not also fix https://github.com/media-kit/media-kit/issues/708
Will test later and report back

Seems to be a regression since https://github.com/media-kit/media-kit/commit/e959173f49008f5d7a1cf92d8bc1576c26bb5bb8.

Build against main branch.


Changing tiles

What is the recommended way to change tiles (json) at runtime? I have tried removing the layer and re-creating it but i end up with gl context is null errors. Im using this in react so its possible its purely a react issue.

Ok so i had to add an onRemove handler in the particle class and disconnect the Particle class 'move' event from the map.
map.off("move", this.move);

Actually just adding the line in the 'Layer' onRemove handler did the trick

@maeneak Sorry for taking your time. Can you provide the detailed trick method for changing tiles (json) at runtime?


Improve add-ons asking prompt

Why
Right now our Rails template ask for Yes or No for every single add-ons. It is not make us feel annoyed that much as we have 5 add-ons at the moment. But imagine if we have more than 10 add-ons, it is gonna be a bad time.
Who Benefits?

Everyone who initiate the app using Rails template

My Opinion
How about if we prompt something like this
Would you like to add following add-ons?
1 : Nginx
2 : PhraseApp
3 : Devise

Enter your prefer add-ons (only number separated by space): <user input>

For example if we want to add Nginx and Devise then just simply type 1 3
Any other ideas are welcome

Instead of asking for all addons, how about we separate the question for each addon group @gutakk ?
What would you like to use for Front-end stuff? (single choice)
1. Boostrap
2. Tailwind
3. ....

What would you like to use for provisioning? (single choice)
1. Heroku
2. AWS
3. ....

https://railsnew.io/ is a good example

it is a good idea if we can make sure that we have to choose only one addon for each addon groups. I'm not sure if we will have the scenario that we need to choose more than one addons in the same addon group? If we have that scenario then this way is not the good idea IMO.
What do you think @andyduong1920

it is a good idea if we can make sure that we have to choose only one addon for each addon groups. I'm not sure if we will have the scenario that we need to choose more than one addons in the same addon group? If we have that scenario then this way is not the good idea IMO.
What do you think @andyduong1920

The group should be separate by category so it must be single choice per each group @gutakk

If we don't have scenario that I mentioned then I agree with your solution @andyduong1920

Are we going with add-on group solution? With current available addons, most groups would have only one option.
What would you like to use for Front-end stuff? (single choice)
0. None
1. Bootstrap

What would you like to use for CI/CD? (single choice)
0. None
1. SemaphoreCI
2. Github Action and Wiki

What would you like to use as a web server? (single choice)
0. None
1. Nginx

What would you like to use for localization? (single choice)
0. None
1. Phrase

What would you like to use for authentication? (single choice)
0. None
1. Devise

What would you like to use as a template engine? (single choice)
0. None
1. Slim Template Engine

What would you like to use for making dynamic UI ? (single choice)
0. None
1. Hotwire

Please suggest any better wording of instructions. With current available add-ons, It seems it would be more annoying for user to go through all these questions.
Suggestion: Until number of add-ons increases, we can go with the alternate solution suggested by @gutakk.
Also, it can be a good time for adding some add-ons for users to choose eg. Tailwind, Heroku, Fly and go with add-on grouping solution.
Looking for your suggestions ...

From my understanding, this change would only benefit to the GitHub vs. SemaphoreCI question, but all the other question would take 3 lines instead of a single (y/N) prompt...
Should we revise this issue to only ask 0. / 1. / 2. for None/Semaphore/Github, and keep the other questions unchanged? 🤔
Or should we just close this issue?
cc @andyduong1920 / @sanG-github (as you contributed on the prompt :) )

I had a quick discussion with Andy and Sang. We agreed that the current prompt (especially since all the questions are asked ahead of the app scaffolding) is OK and so I'm closing this issue to keep the backlog clear :)
Thanks


updated FQDN's to googleapis.com with a trailing dot

PR for Issue #2213

Coverage remained the same at 100.0% when pulling c7868509fa8d65b711fd5f01ae085269a2148d97 on restorationmedia:issue-2213-fqdn-trailing-dot into 184f9bb910d3357d79801ad95b753537a9f47f16 on GoogleCloudPlatform:master.

I caught an issue where scopes cannot have the trailing dot. I'm fixing that now.

I think I got them all, per grep -rni 'googleapis\.com\./auth' * from root of rep

Coverage remained the same at 100.0% when pulling a2115be6279add383af25ad8a7db844f00cf61b0 on restorationmedia:issue-2213-fqdn-trailing-dot into 184f9bb910d3357d79801ad95b753537a9f47f16 on GoogleCloudPlatform:master.

Coverage remained the same at 100.0% when pulling cada67efd7e960b64e4f8620cf8f546620187fa0 on restorationmedia:issue-2213-fqdn-trailing-dot into 184f9bb910d3357d79801ad95b753537a9f47f16 on GoogleCloudPlatform:master.

I discussed this with our team internally and have been persuaded. I do want you to change the maximum line length back to 80, though.

Sure, I can certainly move that back to 80 chars. What is the suggested style choice for the baseUrl lines that have reached 81 chars in the line?

Will something like this be acceptable:
  ¦ it('should set the default base URL', function() {
  ¦ ¦ assert.strictEqual(
  ¦ ¦ ¦ datastore.defaultBaseUrl_,
  ¦ ¦ ¦ 'datastore.googleapis.com.'
  ¦ ¦ );
  ¦ });

Regarding style, whatever you think works best for the block the code is in, including renaming vars to be shorter, or:
var url = [
  'http://www.googleapis.com./...',
  'other-part'
].join('/');

Anything you come up I'm sure will be just fine, and thanks very much for asking!

Will something like this be acceptable:

Yep, that's perfect 👍

Okay, changes made and rebased from upstream. Let me know if anything else needs to change.

Changes Unknown when pulling c343a6e5e14b0a99a7a565b0206b431e3ce42e7b on restorationmedia:issue-2213-fqdn-trailing-dot into ** on GoogleCloudPlatform:master**.

Just assigning to myself -- running the system tests locally had a couple failures, so I'll need to comb over and make sure we've got the dots in the right spots.

@stephenplusplus No need to do an entire umbrella release for this, but maybe release BigTable for @ericuldall. The rest of them can just show up when we release for other reasons.

I stacked on a commit which removes the changes from areas that weren't working as expected and in the files that are generated-- those will have to be edited upstream.
@landrito @jmuk in the generated files, would you be interested in taking on this change?

Coverage remained the same at 100.0% when pulling fc4cde34510a3c8226488e11703da39f47ea8860 on restorationmedia:issue-2213-fqdn-trailing-dot into f0812b6d725fe4882cbad00c63746ca4120b1d27 on GoogleCloudPlatform:master.

Just for the record we're not using Big Table. Our most used api's are Big Query and PubSub.

Coverage remained the same at 100.0% when pulling 773625ba69ee4711d17937ad84aa08ee4b5d9367 on restorationmedia:issue-2213-fqdn-trailing-dot into fa3e960ddb1d76a0d768324b6ac54ba1142dd465 on GoogleCloudPlatform:master.

Due to an issue brought up in #2249, we have reverted this change.


Error during step 2 of "02_prepare_labels.sh"

While trying to make my own voice, I've managed to complete step 1 of "02_prepare_labels.sh" (after properly installing the other tools)
But then during step 2, it fails automatically, and my sincere apologies, but I'm pretty out of my element with the error messaging.
Labels are ready in: /home/al/merlin/egs/build_your_own_voice/s1/label_no_align !!
Step 2: forced-alignment using HTK tools...
---preparing enverionment
---checking data
---extracting features
Traceback (most recent call last):
File "forced_alignment.py", line 379, in
aligner.prepare_training(file_id_list_name, wav_dir, lab_dir, work_dir, multiple_speaker)
File "forced_alignment.py", line 253, in prepare_training
self._HCopy()
File "forced_alignment.py", line 190, in _HCopy
check_call([HCopy, '-C', self.cfg, '-S', self.copy_scp])
File "/usr/lib/python2.7/subprocess.py", line 536, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 523, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 711, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Hello,
he seems to not find a file. are you sure HCopy (the command) is available: HTK/HTS is installed ?

Heya new friend, I ran the compile_htk.sh in merlin/tools, but it's very possible that I made an error during the process. I'll try running that again to see if it'll give me a different result

it sure looks like it installed correctly at the right location, but it has not successfully been able to "make the donuts"
How would you install htk?

If you are facing troubles with HTK, then try other alternative:

change the Labels=state_align to Labels=phone_align in conf/global_settings.cfg
run both steps of 02_prepare_labels.sh

I must be doing something wrong.
Changing state_align to phone_align in global settings and running 02_prepare_labels.sh, I'm encountering the exact same error with references to forced_alignment.py from state_align.
Just trying to run run_aligner.sh in phone_align runs the slt demo, and appears very tied to the demo.
My apologies, but I'm feeling rather clueless

OSError: [Errno 2] No such file or directory

I believe this is because HCopy cannot be found by the forced_alignment.py.  Did you check that paths in https://github.com/CSTR-Edinburgh/merlin/blob/8ff864e22f6c2561b4877193c0145feb29471442/misc/scripts/alignment/state_align/forced_alignment.py#L19-L24 are correct?

I hadn't, but it looks like the place to be... Right?
HTKDIR = "/home/al/merlin/tools/htk" HCompV = os.path.join(HTKDIR, 'HCompV') HCopy  = os.path.join(HTKDIR, 'HCopy' ) HERest = os.path.join(HTKDIR, 'HERest') HHEd   = os.path.join(HTKDIR, 'HHEd'  ) HVite  = os.path.join(HTKDIR, 'HVite' )

doing further research, I'm back to HTK is not properly installed. I found a reference saying "Hvite -V" should produce basic version information. Mine says "no command found". I'm not sure where my installation of HTK (through "tools/compile_htk.sh") failed, as it certainly didn't produce a "failed to build" message.

https://github.com/CSTR-Edinburgh/merlin/blob/8ff864e22f6c2561b4877193c0145feb29471442/tools/compile_htk.sh#L52
Ah, I may find the problem. Can you try HTKDIR = "/home/al/merlin/tools/bin/htk" instead of HTKDIR = "/home/al/merlin/tools/htk"? Also, please make sure that you have htk binaries inside HTKDIR.

New errors = Progress!
Question: I don't see a folder labeled binaries, do you just mean the contents of the htk folder?
python forced_alignment.py
---preparing enverionment
---checking data
---extracting features
Sat Sep  2 03:34:15 2017
---feature_normalisation
Sat Sep  2 03:34:36 2017
---making proto
Sat Sep  2 03:34:43 2017
---training HMM models
ERROR [+7390]  StepAlpha: Alpha prune failed sq(3541) > qHi(3540) at time 81482
FATAL ERROR - Terminating program /home/al/merlin/tools/bin/htk/HERest
Traceback (most recent call last):
File "forced_alignment.py", line 381, in
aligner.train_hmm(7, 32)
File "forced_alignment.py", line 285, in train_hmm
stdout=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/al/merlin/tools/bin/htk/HERest', '-C', '/home/al/merlin/egs/build_your_own_voice/s1/labels/config/cfg', '-S', '/home/al/merlin/egs/build_your_own_voice/s1/labels/config/train.scp', '-I', '/home/al/merlin/egs/build_your_own_voice/s1/labels/config/mono_phone.mlf', '-M', '/home/al/merlin/egs/build_your_own_voice/s1/labels/model/hmm_mix_1_iter_1', '-H', '/home/al/merlin/egs/build_your_own_voice/s1/labels/model/hmm0/macros', '-H', '/home/al/merlin/egs/build_your_own_voice/s1/labels/model/hmm0/hmmdefs', '-t', '250.0', '150.0', '2000.0', '/home/al/merlin/egs/build_your_own_voice/s1/labels/mono_phone.list']' returned non-zero exit status 222

I meant check that htk binarires (i.e., HCompV, HCopy) actually exist.

o~h. Okay. Thank you. Yes. merlin/tools/bin/htk has 16 items. All of them are HSomething.

I'm going to go ahead and close this, as the problem was htk pathing related. I will enter a new report if I encounter a new problem. Thanks!

The original problem hasn't been solved in Merlin. Probably needs fix for build_your_own_voice. I think we should keep the issue open.

reopening per above

I got the ERROR [+2019]  HCompV: Training data file name expected
while running "02_prepare_labels.sh" and I have checked all the paths seems correct.   The error is thrown at check_call([HCompV, '-f', F, '-C', self.cfg,                               '-S', self.train_scp,                               '-M', self.cur_dir, self.proto])
One thing I noticed is that if I give my own path for labels_dir then it throws an error while executing "forced_alignment.py" that labels path not found because it messes up the path by adding path of merlin to the path I have already provided.

I copied the wave and text folders to the /merlin/egs/build_your_own_voice/s1/ directory and that seems to have resolved the issue

I also ended up with same error as @HandsomeDevilv112
ERROR [+7390]  StepAlpha: Alpha prune failed sq(9) > qHi(8) at time 60116
FATAL ERROR - Terminating program ../merlin/tools/bin/htk/HERest

Found some hints to resolve this issue:
https://firojalam.wordpress.com/2014/01/23/herest-error-7390-stepalpha-alpha-prune-failed/
https://stackoverflow.com/questions/5463645/htk-herest-issue

My apologies for not following up.
Yeah, I got past the alpha prune error by turning up the targetrate as suggested by the firojalam wordpress. I forget if I doubled the default rate, or added an extra zero.
I've kinda experienced an unrelated issue that resulted in me having to reformat, so I don't have the information handy, but if memory serves, the next issue I faced was that the files needed to be in mono configuration. This can be solved easily with audacity.

I am stuck at hmm training step since more than half a day now. Any ideas
how can I get the status of the training like usually some kind of error
rates or accuracy values. Its not showing me anything to know the status of
the training.
On Mon 18 Sep, 2017, 08:18 HandsomeDevilv112<EMAIL_ADDRESS>wrote:

My apologies for not following up.
Yeah, I got past the alpha prune error by turning up the targetrate as
suggested by the firojalam wordpress. I forget if I doubled the default
rate, or added an extra zero.
I've kinda experienced an unrelated issue that resulted in me having to
reformat, so I don't have the information handy, but if memory serves, the
next issue I faced was that the files needed to be in mono configuration.
This can be solved easily with audacity.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/CSTR-Edinburgh/merlin/issues/223#issuecomment-330116737,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACiH_J10SYxcC6HUYY9LQOgO8TekDYx-ks5sjdntgaJpZM4PJvnz
.

I remember having a similar thought. I forget the last message printed, but mine eventually finished somewhere in the "half a day" period.
I do agree that some additional messaging wouldn't go unappreciated.

I encountered an identical error as the original poster while trying to build a new voice.
I checked the paths (forced_alignment.py, global_settings.cfg), checked the installation of htk (provided compile_htk.sh was not successful, I copied a functional installation into tools/htk), to no avail.
Does it need a fix in Merlin or does anybody have a hint what I could try? Thanks.

just to ask, did you do the whole login/password dance to install HTK? It's a bit of a pain.

Just wanted to note that I got stuck at hmm training step too. No progress after the log message:
Step 2: forced-alignment using HTK tools...
but the process was running for more than a day.
I am using Python 2.7 and the subprocess.check_call documentation says "Do not use stdout=PIPE or stderr=PIPE with this function as that can deadlock based on the child process output volume". But the train_hmm() function in forced_alignment.py runs HERest using check_call with stdout=PIPE
It progressed for me after explicitly opening a file and changing stdout=stdoutlog.

Step 2:
Preparing labels...
mkdir: cmu_us_IIIT: File exists
Copying labels to duration and acoustic data directories...
sed: 1: "experiments/IIIT/durati ...": invalid command code e
sed: 1: "experiments/IIIT/acoust ...": invalid command code e
done...!

@Sangramsingkayte

Are the labels correctly created in your $lab_dir? I guess not since your log does not print "You should have your labels ready in: <>". Maybe you could  try deleting cmu_us_IIIT and retry?

(These label filenames are written to $FileIDList and the sed command just removes the .lab extension, you could go through the 02_prepare_labels and run_aligner scripts line by line)

If (1) is not the case, are you running on Mac OS? It has a lot of idiosyncrasies when compared to Unix/Linux (https://markhneedham.com/blog/2011/01/14/sed-sed-1-invalid-command-code-r-on-mac-os-x/)

DrSangramsings-MacBook-Air:s1 sangramsing$ bash ./02_prepare_labels.sh ./database/wav ./database/txt.txt ./database/labels
Step 2:
Preparing labels...
mkdir: cmu_us_sing_iiit: File exists
Copying labels to duration and acoustic data directories...
sed: 1: "experiments/sing_iiit/d ...": invalid command code e
sed: 1: "experiments/sing_iiit/a ...": invalid command code e
done...!

got the same issue related to hmm training. Here is the output of error
95.lab
96.lab
97.lab
98.lab
99.lab
forced-alignment using HTK tools...
HTK step 1 success
HTK step 2 success
HTK step 3 success
---preparing enverionment
---checking data
---extracting features
Fri Jun  7 11:16:18 2019
---feature_normalisation
Fri Jun  7 11:16:25 2019
---making proto
Fri Jun  7 11:16:25 2019
---training HMM models
Traceback (most recent call last):
  File "/home/virtuoso_irfan/merlin/misc/scripts/alignment/state_align/forced_alignment.py", line 381, in <module>
    aligner.train_hmm(7, 32)
  File "/home/virtuoso_irfan/merlin/misc/scripts/alignment/state_align/forced_alignment.py", line 285, in train_hmm
    stdout=PIPE)
  File "/root/anaconda3/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/virtuoso_irfan/merlin/tools/bin/htk/HERest', '-C', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/cfg', '-S', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/train.scp', '-I', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/mono_phone.mlf', '-M', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm_mix_1_iter_1', '-H', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm0/macros', '-H', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm0/hmmdefs', '-t', '250.0', '150.0', '2000.0', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/mono_phone.list']' returned non-zero exit status -11
Force-alignment unsucessful!! Please check /home/virtuoso_irfan/merlin/misc/scripts/alignment/state_align/forced_alignment.py
Copying labels to duration and acoustic data directories...
done...!

Hi @mirfan899
If you try and run forced_alignment.py by itself you can try and debug from the output of that. It'll give you more helpful errors.

I believe adding new voice is not clear. There are missing links to build the custom voice. For example no information about questions set, phoneme_map.dict. No clear errors found when I tried to run forced_alignment.py. It just shows
subprocess.CalledProcessError: Command '['/home/virtuoso_irfan/merlin/tools/bin/htk/HERest', '-C', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/cfg', '-S', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/train.scp', '-I', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/mono_phone.mlf', '-M', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm_mix_1_iter_1', '-H', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm0/macros', '-H', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm0/hmmdefs', '-t', '250.0', '150.0', '2000.0', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/mono_phone.list']' returned non-zero exit status -11
Force-alignment unsucessful!! Please check /home/virtuoso_irfan/merlin/misc/scripts/alignment/state_align/forced_alignment.py

Try running the command that the python program is running (HERest) and see the errors the

So here is what I get when I try to run check_call on HERest
WARNING [-7325]  LoadUtterance: No labels in file /home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/mfc/10.lab in /home/virtuoso_irfan/merlin/tools/bin/htk/HERest

It looks like check_call using HERest looking into wrong directory for labels file.
check_call in train_hmm
check_call([HERest, '-C', self.cfg, '-S', self.train_scp,
                            '-I', self.phoneme_mlf,
                            '-M', next_dir,
                            '-H', os.path.join(self.cur_dir, MACROS),
                            '-H', os.path.join(self.cur_dir, HMMDEFS),
                            '-t'] + PRUNING + [self.phonemes],
                           stdout=PIPE)

Here are the paths which are set for running this function
/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/cfg
/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/train.scp
/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/config/mono_phone.mlf
/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm_mix_1_iter_1
/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm0/macros
/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/model/hmm0/hmmdefs
['250.0', '150.0', '2000.0', '/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/mono_phone.list']

I think it's a language issue. I'm using Urdu and it causes issues with underlying scripts for building labels as utterances generated by Merling are in ascii but Urdu requires unicode.

It sounds unlikely to be a unicode issue. Unless you use unicode in the labels you generate?
Even then, the error you report is HEREst looking in the wrong directory? Why not fix that?

After looking hard into the issue, did not get anything good. From this warning message
WARNING [-7325]  LoadUtterance: No labels in file /home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/mfc/10.lab in /home/virtuoso_irfan/merlin/tools/bin/htk/HERest

HERest is looking for 10.lab file but mfc directory only contains *.mfc files. Further investgating the issue, I got config/train.scp script file used in HERest and contains the absolute addresses of mfc files.
I've also looked for error on Google and here are the links that provide some info
https://www.xuebuyuan.com/2063956.html
https://anggarrgoon.wordpress.com/tag/htk/
http://electroblaze.blogspot.com/2013/03/understanding-htk-error-messages.html

I think something might be off in your mlf file: can you check its syntax and the existence of the directory(ies) indicated inside

here is the content of mlf file
#!MLF!#
"*/*.lab" -> "/home/virtuoso_irfan/merlin/egs/build_your_own_voice/s1/database/labels/mono_no_align"

Hi, I got the same problem. You have to check if you have all the labels inside the database/labels/mono_no_align, then check if the file that is given you the error 10.lab has anything inside. In my case, this was the problem as the file was empty. I just took it out from the file_id_list of the forced alignment. Then the alignment ran ok. Hope that helps!


feat(flavored-markdown): add support for file url clicks

Description

File url click support in Markdown and FlavoredMarkdown components
Theming for code-editor web component

What's included?

Add an input property called fileLinkExtensions and an output event called fileClicked in Markdown and FlavoredMarkdown components.
For all the links which end with the provided file extensions the default click behavior will be prevented and an output event will be emitted. Consumers can capture this event and handle the click logic.
When the hostedUrl property is set, this will be prepended to all file links.
Theming for code-editor web component. Note: We might need to create custom themes for supported languages.

Test Steps

[x] npm run start
[x] Run the docs app
[x] Open Markdown or FlavoredMarkdown component demos and pass the hostedURL and fileLinkExtensions properties. Add links which end with these extensions in the markdown content and verify the click action.

General Tests for Every PR

[ ] npm run start still works.
[ ] npm run lint passes.
[ ] npm run stylelint passes.
[ ] npm test passes and code coverage is not lower.
[ ] npm run build still works.

Screenshots or link to StackBlitz/Plunker
File links

Code-editor

:tada: This PR is included in version 8.20.0 :tada:
The release is available on:

v8.20.0
GitHub release

Your semantic-release bot :package::rocket:


Why a stack machine instead of a register machine?

Why is Wren's VM a stack machine and not a register machine? The tradeoffs are pretty well known: stack VMs are simpler and usually generate smaller bytecode, while register VMs are a little tougher to generate code for and generate fewer instructions (making them faster in general).
Lua provides a good reference for code generation and interpretation for a register VM.

I've implemented a register-based VM before. I think it's a cool model, but I don't think it would bring much benefit for Wren. It is a bit more difficult to compile, and I'm trying to keep Wren's implementation as simple as possible.
In return for that complexity, you can generate fewer instructions. However, I don't think Wren would be able to take advantage of that. In Lua, a statement like:
a = b + c

Can compile to a single instruction: an ADD with operands from local registers a and b that stores into local register c. Wren doesn't currently have any dedicated instructions for arithmetic. Operators are just regular method calls and can call user-defined procedures.
The calling convention for methods requires all of their parameters to be at the stop of the caller's stack so that they can become bottom of the callee's stack frame window. So, to call + in Wren, we still have to push the arguments on top of the stack. Likewise, the method calling convention places the return value where the first argument was, so we'd have to move it back down to the destination slot after the call.
It may be worth having dedicated instructions for arithmetic that special case the built-in types before falling back to user-defined operator methods (which I assume is what Lua does since they added operator overloading late in the language's development). If that happens, it may be possible to switch to register-based.
But I'm not convinced it would be an actual performance win. A lot of details of the language affect whether a register-based VM is better. For example, assignments are statements in Lua but expressions in Wren, which would make them harder to compile to efficient register-based code.

Thank you for the very detailed response!
I might still play with the idea once the language has stabilized a bit. I'll share my results if I do, but won't have any expectation of getting anything merged.

Perhaps some of that could go into the Q&A page...

Good idea! Done: http://munificent.github.io/wren/qa.html#why-is-the-vm-stack-based-instead-of-register-based


KAFKA-3255 Added unit tests for NetworkClient.connectionDelay(Node node, long now)

@frankscholten Tested locally and worked. Thanks. Nit-picking: could you remove the 2 empty lines between "selector.close..." and "long delay..." in testConnectionDelayDisconnected. Otherwise LGTM.

LGTM. @ewencp if looks good to you would be good to merge. Thanks.

LGTM


SpringMVC: RestControllers / ResponseBody unable to add tracee header to response

Our implementation of io.tracee.binding.springmvc.TraceeInterceptor is not working with methods that return a body (instead of a view name) -- If the class is annotated by @RestController or the method/class is annotated by @ResponseBody the underlaying renderer (fe. Jackson for Json responses) is commiting the response before our interceptor could add the tracee header.
I think we can fix this only for Spring 4.1: They introduced a new Interface: ResponseBodyAdvice<T>
See following documents for more information:

https://jira.spring.io/browse/SPR-9226
https://jira.spring.io/browse/SPR-10859
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyAdvice.html

I think this bug is fixed with 3.2.2 or higher versions. I'll write some tests to keep sure this is the case. See this spring issue for more information: https://jira.spring.io/browse/SPR-10095
Maybe we should update to Spring 3.2.12 with the upcoming TracEE 1.1.0 version. This is no breaking change because the API is still the same.
Spring 3.1 is retired since January 2014.

After some investigation I come to the conclusion that using a newer version of spring isn't the solution for this bug. The output stream is flushed by Springs AbstractHttpMessageConverter. Due this flush it's understandably not possible to add additional header.
We're discussing some other solutions that are compatible with lower spring versions than 4.1. A solution could be to add the header in the preHandle method and try to override it with the setHeader method in postHandle. This ensures that at least the invocationId and all received params are in the response.

I wonder if it would be more confusing to see stale data in the response header (maybe the service overwrote a tpic field - but it is not propagated back) - or to see no tpic header in the response at all.
Maybe we could add a tpic-field like provisional:true on the preHandle written header.

Just ran into this issue. The workaround is using tracee-servlet instead.

Ohh really? Because both (the Servlet-Filter and the io.tracee.binding.springmvc.TraceeInterceptor works with the ServletResponse. If the body of the http response is written to the cable it's not possible to add a header later one. But maybe springs use some kind of wrapper to cache the ServletResponse.
I'll check that the next days.

@SvenBunge
Maybe that's because in TraceeFilter, the header TPC is set before filerChain while in [TraceeInterceptor] (https://github.com/tracee/tracee/blob/master/binding/springmvc/src/main/java/io/tracee/binding/springmvc/TraceeInterceptor.java) the header is set only in afterCompletion ?

@Hippoom : Ahh, there is a work-around in the TraceeFilter. @danielwegener and me talked about to integrate this workaround in all kind of filters / interceptors.
But there are some trade-offs:

If the server add/replace some variables to the TPIC they aren't transfered back.
We should find a way to replace the previous written header if not written to the wire.
As far as I know: Headers in Request and Response doesn't have a clear defined order.
We've to parse all TPIC headers of the Response and merge the values together. The latest header can override all values of the previous one but it could be wrong (see point 3).
You can't delete/replace values from the TPIC because they've written to the Response before. (Or we find a way to replace the previous header (point 2).

I'll check this approach and come with some investigation results. Thanks for the hint!

I'll check all implementations that we use setHeader(..)-equivalent methods to set the header instead of addHeader(..).

I've checked all our implementations. I think only Spring MVC is affected so I've created #136 to add the same workaround like we already have integrated in the servlet module.
(Client modules are not affected, Async module like quartz are not affected, jaxrs, and all WS implementations seems to write the whole body at once. -- so only the servlet and the spring mvc is able to commit the headers before we're able to add the final TPIC).
I'll leave this issue open until we can jump up to Spring 4.1. Yet some ppl are still using older versions of Spring (like 3.2 or 4.0)

With  #144 we could fix this issue in TracEE 2.0

#166 fixes this issue. So I'll close this issue yet. The fix / new feature is included in the upcoming tracee 2.0 and not backportable because of the spring version dependency.


dca-rs broken, FAQ outdated

It seems like a few of the dependencies for dca-rs are no longer being maintained causing it to not build. Because of that the FAQ on playing audio over a voice connection is now out of date.

Updated to point at https://github.com/jonas747/dca


shuffle=False in Dataloader does not work

I want to train the model as the original orders, and I change shuffle=(sampler is None) and training to shuffle=False, but it does not work, the frame id is also random. Is there any reason behind this? Hoping for your reply.

Would you like to provide more details, like the order, dataset, and order before/after such change?

When I set shuffle =False, it seems that the first sample idx is random, and the following sample idx is in sequence.

That's pretty strange for me. I haven't met this before.

That's pretty strange for me. I haven't met this before.

I found the reason in this line. The first index is randomly chosen because I only train the car class and there is no car in frame id 000000.


Mainpage "rotation lock" set incorrectly

At the moment, the "rotation lock" for the molecule of the week is set incorrectly by default. It looks like rotation should occur, but it doesn't.

Fixed. Not pushed to production yet.


Refactor patient-details module

Merge address-levels directive with patientAddressStep

Remove bahmniAutocomplete and use ui-bootstrap typeahead

Remove unnused dynamicName directive

Move patient-details module to patient module

Create directives for each patient details part

Display HIV testing info on patient details (Fixes #635)

 Refactor patient-details and move to common

Coverage increased (+1.5%) to 68.617% when pulling 8de4e97319179de55f9bab13c5511bed059ef273 on ynurmahomed:patient-details into c5c37f5bc54c733cd0dba2fc519d6444cf65e4b4 on esaude:master.

Closed #635


Resolution of Issue#3010

Resolution of Issue #3010 using an important note.

(Ref. PR #3190, replaced by this PR.)

@nenonix @JohanFreelancer9 - kindly do the copy editor review for this PR. Thanks.

@j0rt3g4 - please merge the commit on the copy/edit review made by JohanFreelancer9 or make the necessary changes on the PR following the suggestions he made. Thank you.

@j0rt3g4 - I would like to follow up on this. Have you already merged the commit on the copy/edit review made by JohanFreelancer9 or make the necessary changes on the PR following the suggestions he made?

@mypil The updates have been committed.

@greg-lindsay - Can you please assist to check, approve and merge the content for this PR based on issue #3010?
Thank you.

@AndreaBarr - would you be able to merge the content of this PR? Thank you.

@mypil I have contacted Greg via email to review this PR since it adds a note that I can't verify myself.

Added  comments @mypil

@greg-lindsay - We would like to follow up on this. Can you please assist to check, approve and merge the content for this PR based on issue #3010?
Thank you.


Linux fixes

This might fix #68, at least it does so for me.
After some printf debugging, I noticed that Inifile implementation uses file:lines() to read the ini file, but does not break at the nil that signifies the end of the file. Instead it unconditionally calls line:match(…) here, even when line == nil.
I have no idea why this only fails sometimes for some people, but for me it was 100%, maybe because under Linux BizHawk uses a different Lua backend.
Also contains a fix to use / instead of \ as the path separator. This fixes loading the next rom under Linux. I believe also works on Windows since 7 or 8, but someone with a Windows machine needs to test this. It did work for me under wine, but that might behave differently in this regard. Otherwise it needs to be some hack like package.config:sub(1,1) to be compatible with both.

I opted to add the workaround instead of modifying the Iniflile.lua as that seems to be 3rd-party code.

Tested on my Windows 10 machine. It seems good. Thanks for not modifying the IniFile.lua code and implementing the workaround instead.
I did initially get some panic crashes from the Lua engine when trying to load the next seed with the button combination, but after restarting BizHawk and trying again with a controller rather than a keyboard, it worked fine. The keyboard wasn't the issue, because I did try with both joystick and keyboard after restarting BizHawk, so I think it has to do with using the Settings menu to initially set the Roms folder, which I had to do since I was using your code for the first time, which had the default Settings.ini. While the engine panic crash is not associated with the first time run errors brought up in Issue #68, I am happy to see that this will address the issues Linux users were facing.


Default values override "required" state in output types

Description
Generated types don't allow undefined inputs on fields with default values, even if they're not part of the "required" fields array.

Name
Version

openapi-typescript
7.0.2

Node.js
v20.12.2

OS + version
macOS 14.5

Reproduction
Create a package.json like:
{
  "name": "test-scripts",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "http-server -p 4000",
    "generate": "tsx ./generate-types.ts > ./openapi-output.ts"
  },
  "dependencies": {
    "openapi-typescript": "7.0.2",
    "tsx": "4.7.1",
    "typescript": "5.4.5"
  },
  "devDependencies": {
    "http-server": "14.1.1"
  },
  "author": "",
  "license": "ISC"
}

Add a docs-json file with:
{
  "openapi": "3.0.0",
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/do/the/thing": {
      "post": {
        "operationId": "Controller_method",
        "summary": "Do something.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MyInputType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Did the thing."
          },
          "400": {
            "description": "Bad request."
          }
        }
      }
    }
  },
  "info": {
    "title": "Test API",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/license/mit"
    },
    "description": "",
    "version": "1.0",
    "contact": {}
  },
  "tags": [],
  "servers": [
    {
      "url": "https://some.site.com/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "MyInputType": {
        "type": "object",
        "properties": {
          "requiredField": {
            "type": "string"
          },
          "optionalField": {
            "type": "string"
          },
          "optionalFieldWithDefault": {
            "type": "string",
            "default": "foo"
          }
        },
        "required": [
          "requiredField"
        ]
      }
    }
  }
}

and a generate-types.ts file with:
import openapiTS from "openapi-typescript";
import ts, { EmitHint } from "typescript";

openapiTS("http://<IP_ADDRESS>:4000/docs-json", {
  alphabetize: true,
}).then((output) => {
  const outFile = ts.createSourceFile("API.ts", "", ts.ScriptTarget.Latest);
  const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
  output.forEach((typeNode) => {
    console.log(printer.printNode(EmitHint.Unspecified, typeNode, outFile));
  });
});

Run yarn start in one terminal window and yarn generate in another. This creates an openapi-output.ts file.
Expected result
I expect a schema which looks like this:
        MyInputType: {
            optionalField?: string;
            /** @default foo */
            optionalFieldWithDefault?: string;
            requiredField: string;
        };

But this is what the script outputs:
        MyInputType: {
            optionalField?: string;
            /** @default foo */
            optionalFieldWithDefault: string;
            requiredField: string;
        };

I'm surprised by this because the "required" array is part of the offical JSON schema spec, whereas the default value is (to the best of my knowledge) not. The closest thing I could find to documentation was here, where the docs say:

Unless stated otherwise, the property definitions follow those of JSON Schema and do not add any additional semantics.

So I would expect the ? types to be determined by "required" fields only.
Checklist

[x] My OpenAPI schema passes the Redocly validator (npx @redocly/cli@latest lint)
[ ] I’m willing to open a PR (see CONTRIBUTING.md) (I may be open to this, but don't want to commit to it as I'm not familiar with this project and unsure how tough it would be)

@dave-addition You can take part in this：https://github.com/openapi-ts/openapi-typescript/pull/1746#issuecomment-2221874701

Thanks!


Declarative server errors

Currently it seems the only was to add server errors is using the invalidateForm callback on the onSubmit handler. This works well in a simple case where the submission XHR is located there.
However, when things get a little more fluxxy, this callback stops working well.
For example,
class Login extends Component {
  static propTypes {
    fieldErrors: PropTypes.object,
  }

  handleSubmit(data) {
    store.dispatch(login(data));
  }

  render() {
    const { fieldErrors } = this.props;

    // ???

    return (
      <Form onValidSubmit={::this.handleSubmit}>
        <Input label='Email' name='email' type='email' validations='isEmail' required/>
        <Input label='Password' name='password' type='password' required/>
        <Button>Login</Button>
      </Form>
      <div>
    );
  }
}

In this login form example, the submit handler simply dispatches a redux action. It has no knowledge (and shouldn't have knowledge) of what that action does. All it knows is that if fieldErrors come back via props it should display them.
Right now there doesn't seem to be a way to display these field errors.

Use updateInputsWithError


Feature examples

Codecov Report

Merging #15 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop      #15   +/-   ##
========================================
  Coverage    99.39%   99.39%
========================================
  Files           39       39
  Lines          332      332
========================================
  Hits           330      330
  Misses           2        2

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 7b210f2...dc391ec. Read the comment docs.


There is no way to define a column for default sorting

There is no way to define a column for default sorting

This should be a good place for improvement.
For now, try ordering the dataset outside the plugin on initial render

I have tried, but when the tables render there are always some rows out of order.
In my case the first one will always be the row with id 57,  but when i click to sort by id everyting fixes up....
I also noticed that the demo image in the documentation has the same error (first one is id 26)

@rodrigoAbril I understand that your question was asked nearly 2 years ago, but here is temporary solution:
in DatatTable.vue find sortColumn data and change it to the column number you want your component to be sorted by on init.
@MicroDroid can we implement some new prop (:initSort=column number for example), which will change initial sorting?

:) seems like a good solution

@justice47 I'd rather find a better way since this is a controlled component and I'd rather not use local state with a prop like that.

@MicroDroid ok, if you will find a better way just post your thoughts about it, I can try to help you with that!

@MicroDroid maybe with approach will suit all needs:
Lets stay with currentPage in data and change it only once, then component is mounted.
Example:
props
props: {
 ...,
 initSortCol: {default: 0}
}

data
data: () => ({
 ...,
 sortColumn: 0,
}

mounted hook
mounted: function() {
 ...
 this.sortColumn = this.initSortCol
}

and then in component call
<datatable
 ...
 :initSortCol="2"
>

Closed in #42


How can we override dependencies "version" in helm chart Chart.yaml file?

I am wondering and apparently have not yet found anywhere if there is a way via which I can specifically override the value of "version" key's value from the dependencies chart in Helm
# Chart.yaml
dependencies:
- name: bitnami/postgresql
  version: **"8.10.5"**
  repository: "https://charts.bitnami.com/bitnami"

I tried something like below:
# Chart.yaml
dependencies:
- name: bitnami/postgresql
  version: "{{.Values.postgresql.version}}"
  repository: "https://charts.bitnami.com/bitnami"

and
# Values.yaml
postgreSQL:
  version: "8.10.5"

But I am getting below error:
Error: cannot load Chart.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{".Values.postgresql.version":interface {}(nil)}

If this is currently not possible then can someone advise how do you update the "version" of dependencies in Charts.yaml whenever new version is available of them?
Output of helm version:
version.BuildInfo{Version:"v3.7.1", GitCommit:"1d11fcb5d3f3bf00dbe6fe31b8412839a96b3dc4", GitTreeState:"clean", GoVersion:"go1.17.2"}

Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.5", GitCommit:"aea7bbadd2fc0cd689de94a54e5b7b758869d691", GitTreeState:"clean", BuildDate:"2021-09-15T21:10:45Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: net/http: TLS handshake timeout

Cloud Provider/Platform (AKS, GKE, Minikube etc.):  kind cluster

https://helm.sh/docs/chart_best_practices/dependencies/#versions

@NiniiGit did you find a solution for this? i'm looking to do something similar as well

Hello @soumyabk ,
What @bacongobbler suggested way was the solution I went ahead with actually. There is no way you can variablise the "version" field in dependency section of your helm chart.yaml file

Does this help? https://helm.sh/docs/chart_best_practices/dependencies/#versions

Where possible, use version ranges instead of pinning to an exact version. The suggested default is to use a patch-level version match:

version: ~1.2.3

By doing this you ensure helm dependency update will pull the latest version that best matches the version range provided.

Thanks @bacongobbler as I worked in this way


feat: Add My Collection artwork comparable works section

The type of this PR is: Feature

This PR resolves CX-2368
Description
Add My Collection artwork comparable works section.
PR Checklist (tick all before merging)

[ ] I have included screenshots or videos to illustrate my changes, or I have not changed anything that impacts the UI.
[ ] I have tested my changes on iOS and Android.
[ ] I have added tests/stories for my changes, or my changes don't require testing/stories, or I have included a link to a separate Jira ticket covering the tests.
[ ] I have added a feature flag, or my changes don't require a feature flag. (How do I add one?)
[ ] I have documented any follow-up work that this PR will require, or it does not require any.
[ ] I have added an app state migration, or my changes do not require one. (What are migrations?)
[ ] I have added a changelog entry below or my changes do not require one.

To the reviewers 👀

[ ] I would like at least one of the reviewers to run this PR on the simulator or device.

Changelog updates
Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

Warnings

:warning:

❌ An error occurred while validating your changelog, please make sure you provided a valid changelog.

  Generated by :no_entry_sign: dangerJS against 13c5cca8dd86794dcdaaf281891057c125ccac6b

#squashongreen


Liked songs displayed as playlist

Is your feature request related to a problem? Please describe.
I have tons of tracks just lying around in my liked songs collection and would like to play directly from there.
Describe the solution you'd like
Is there any way to include them as a playlist?
Describe alternatives you've considered
I could also add them into an external playlist, but with 450+ tracks that is pretty tedious.

After digging through the commands, I found the one for displaying all liked songs. Still I find it more convenient to have them show up as a playlist

You can start a playback from liked song page like a playlist page.
Due to its API restriction, it's impossible to treat liked songs as a Spotify playlist.
Will close this issue for now as using liked song page should be enough.


Pre.commit failed with ontology.py

I got a problem with pre.commit for ontology.py related to pylint.
Error message are like:
Parameter 'fileobj' has been renamed to 'filename' in overridden 'Ontology.load' methodPylint(W0237:arguments-renamed)

Seems to be working now, so I close this.

Was it tested on both Linux and Windows (just in case there are OS differences)?

I do not get the same error anywhere. Can you reproduce it? If not I think we should close it..

Should I test on branch master?

yes, or make a new branch out of master.

tested and no complain from pylint


Update section about running on WildFly

update the JRuby dependency (this is required to make it work with WildFly 17.0.1, and matches the JRuby version that the current v2.1.0 depends upon)
rename "WildFly AS" to just "WildFly"

Thank you for your PR!
Could you please also update the version of JCommander in the README?
We are using 1.72 right now.

You're welcome. I updated the version of JCommander as well.

Thanks!


Update gitignore

Description

.cache/: symbols cache, generated by clangd
compile_commands.json: usually generated by vscode or build system
.vsocde: generated by vscode

compile_commands.json and .vscode are usually specific to a person's
environment, not configurable in any way, so there is no reason to put
them in the git repository.

Can you explain exactly where compile_commands.json comes from and why it needs to be ignored? From googling it seems to be a vscode file, why is it not in the .vscode directory? The other two ignores seem fine to me.

Can you explain exactly where compile_commands.json comes from and why it needs to be ignored? From googling it seems to be a vscode file, why is it not in the .vscode directory? The other two ignores seem fine to me.

compile_commands.json is required for the clangd language server to work. CMake will generate this file under the build directory when requested. However, there are some circumstances where compile_commands.json needs to be modified. Thus, we need to create a copy at the top level directory, as clangd will prioritize it over the one in the build.

Furthermore, this compile_command.json file is tied with the specific build environment, making it non-portable and therefore should be ignored.

It seems like you could edit the file in build then, but fair enough that seems reasonable. Can you update it to only apply to the file in the root? i.e. /compile_commands.json


Add GSSOC logo and PR rules in the readme

You have two sub-tasks :
1)Add a rule under the section explaining pull request in readme  to add screenshot or screen-recording when submitting a  PR.
2)Add a GSSOC logo in the 2nd last section . (Part of these open source programs . )

Hii ! I'm a GSSoC'22 contributor. Can I work on this issue ?

@aaryahjolia  I have assigned the issue to you , Best Wishes for ant problem reach out to me on discord .

Hey may you assign this issue to me please, I can work on this much effectively.

@Atharv-110  wait for few more hours if the current assigned is not able to close this I will assign it to you

I will merge a PR in sometime only.

@SaraswatGit It will be good for contributors if you close this issue.


[Fix #2003] Handle --auto-correct in Lint/UnneededDisable

The problem is this. When Runner calls FormatterSet#file_started, it gives the cop_disabled_line_ranges and comments and they are stored in FormatterSet. Then Runner starts its inspection loop for the file and each time the file is updated (by autocorrect), a new processed_source object is created with new cop_disabled_line_ranges and comments. But the references in FormatterSet are still to the original ranges and comments.
The solution is to send delegator objects to file_started. These delegators are updated each time the code is parsed again after correction, so that the disabled lines and comments that Lint/UnneededDisable uses are the latest, rather than the ones given before inspection started.
Supersedes and closes #2380.

Looks better! :+1:


Docker deployment

Any plans for a docker image for a simple one command setup?

No, this project is done. I'm focusing on new ones.


New feature request: Convert a pdf in pdf/A

Add in qpdf a simple command to convert a normal pdf in a pdf/A

I'm not sure what pdf/A is specifically. Is that with accessibility? This is very likely something that would be out of scope for qpdf itself. If that's not what you're asking for, please clarify. Thanks!

For pdf/A i mean https://en.wikipedia.org/wiki/PDF/A
I think that PDF/A-1 format is enough
Some organizations ask pdf/A format for preservation of electronic documents.
But after i use qpdf to manipulate pdfs, they are no more in pdf/A format.
So i request a feature that can simply convert a pdf in a pdf/A, in this way that organizations accept the pdf/A (but not a normal pdf).

I'm afraid this is not possible with qpdf. Generating PDF/A will be the responsibility of the original PDF creation software. Converting a PDF file to PDF/A goes well beyond just content transformations. It would probably be possible for someone to use the qpdf library to check whether a PDF file is compliant, and qpdf could be used to perform some of the operations, but in general, this would be out of scope for what the qpdf library is designed to do.

It's an old issue but can be useful for others with the same need. ocrmypdf can convert to PDF/A:
ocrmypdf --tesseract-timeout=0 --remove-background input.pdf output.pdf

https://ocrmypdf.readthedocs.io/en/latest/cookbook.html#don-t-actually-ocr-my-pdf

For clarification... ocrmypdf mostly relies on qpdf (thanks to pikepdf) but PDF/A export is performed by Ghostscript (not by qpdf):
https://github.com/ocrmypdf/OCRmyPDF/blob/d9eb0ba7efff5ae691d84a6bec40b39b7ad593a6/src/ocrmypdf/_exec/ghostscript.py#L199

Since my original comment, changes were made to qpdf to preserve PDF/A if the file is already PDF/A compliant, but qpdf still can't create PDF/A from a non PDF/A file.


Update of lang files

Can you please update sl.yml from Transifex. If you'd prefer to do it via PR, I can prepare one.

We'll be pulling translations from transifex as part of the upcoming CWP 2.8 release
Cheers


Defaulting to SASL plaintext wasn't working for consolidated channel

Add additional testcase, change how we default to plaintext SASL

/retest

/test all


Error while opening the database on React 0.71.2

Error while opening the database on React 0.71.2
Expected Behavior
Open the database as expected
Current Behavior

Possible Solution
I'm not sure of what can be done to solve this
Steps to Reproduce (for bugs)
Just follow the instructions in the readme file.
Context
Cannot use the library with the latest version of react-naive.
Your Environment

React Native SQLite Storage Version used: 6.0.1
React Native version used: 0.71.2
Operating System and version (simulator or device): Device and simulator
IDE used: Visual studio code.
Link to your project:

Debug logs
 LOG  Running "SQLiteApp" with {"rootTag":1,"initialProps":{}}
 LOG  Queries:  ["CREATE TABLE IF NOT EXISTS todos ( name TEXT NOT NULL, description TEXT, isCompleted INTEGER )"]
 LOG  Error:  [TypeError: Cannot convert null value to object]
Process terminated. Press <enter> to close the window

Note: I got another project using react-native 0.69.5, and the library works as expected, what leads me to think it's only happening with the latest version of react-native, the following is an output executing a query (With wrong syntax sorry) on react-native 0.69.5.

Hello @alejandro-devop, I've finally found a solution working for me. Hope it helps:

uninstall app (I guess that's this step which saved me)
make sure you followed install instructions for your supported platform (this link could help you)
make sure (with DBBrowser for SQLite for example) that your db file is OK
use this code to open your database =>  openDatabase({ name: 'filename.db', createFromLocation: 1, location: 'Library'})
do not hesitate to clear and re-add your db file in the native projects just to be sure
reinstall app

Should be working now

@alejandro-devop did you find any solution?


Nexus exporter not reporting metrics

I was not able to install the nexus exporter.  This is the relevant section of the statefulset yaml
 - name: nexus-exporter
          image: ocadotechnology/nexus-exporter
          env:
          - name: NEXUS_USERNAME
            value: "admin"
          - name: NEXUS_HOST
            value: "http://localhost:8081"
          - name: NEXUS_ADMIN_PASSWORD
            value: "<nexus password>"
          ports:
          - containerPort: 9184
            name: http-metrics
          resources:
            requests:
              cpu: "500m"
              memory: "500Mi"

The serviceMonitor yaml is
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: nexus
  labels:
    app: nexus
    release: prometheus-operator
spec:
  selector:
    matchLabels:
      app: nexus
  endpoints:
  - port: http-metrics
    interval: 10s

However , the log just shows the nexus container with a message "starting"  and nothing else.
kubectl logs -f nexus-0 -c nexus-exporter
starting...

It doesn't move past that.  Please let me know if there is anything Im missing.   The associated objects are

statefulset
serviceMonitor
service for statefulset

Thanks

that is the only 'log' (actually a print line) message currently, other than fatal messages, just to confirm that it has started.
if you port-forward to your pod do you not see metrics?
kubectl -n <your-namespace> port-forward pod/<your-pod> 9184:9184 &
curl localhost:9184/metrics

I was able to figure it out.  I needed to explicitly create a service that maps to the port in the sidecar directly.  It works now Thanks


TypeError: Unexpected response from worker: undefined

I'm using ts-node to run nextjs app (custom server).
yarn dev: ts-node --project tsconfig.server.json server/index.ts
Using tsx throws the below error
/Users/<path>/node_modules/jest-worker/build/workers/ChildProcessWorker.js:264
        throw new TypeError('Unexpected response from worker: ' + response[0]);
              ^

TypeError: Unexpected response from worker: undefined
    at ChildProcessWorker._onMessage (/Users/<path>/node_modules/jest-worker/build/workers/ChildProcessWorker.js:264:15)
    at ChildProcess.emit (node:events:527:28)
    at emit (node:internal/child_process:938:14)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

p.s: thanks for bringing this :)

Do you mind providing a minimal reproduction repository?
I'm not sure what exact setup and commands you're running.
Also note, tsx currently doesn't support the --project flag.

Sorry, I'm not able replicate the same error on the starter: https://github.com/s-kris/test-tsx-nextjs-custom-server
I will try to add the packages one by one from my main project to this starter to identify which one is causing the issue.
By looks of it, I think, it must be the testing library.

Thanks.
Will reopen when reproduction is provided.