💭 How to support pagination with this?

🤔 How to support pagination with this?
I am trying to fetch the videos but with pagination. And I already setup required things, but not sure how to fit it in the end. As I find this code a bit complex architecture to understand. I don't have much experience with flows.
What I did for paging is:

[x] VideoDataSource
[X] PagerPagingAdapter

Now problem here is, in the code there are many things which are shared in a flow, which extends ViewResult, I am referring to the VideoPagerViewModel, according to the code I am able to use Flow<List> but according to my implementation I will be getting Flow<PagingData> this is where the issue is happening, I can't make the PagingData extend ViewResult directly also. So how can I achieve the pagination in this? Because in ShortsFragment I can see that code fetches all the videos at once.
ShortsFragment (🗝 Already Present)
.
.
val states = viewModel.states
            .onEach { state ->
                // Await the list submission so that the adapter list is in sync with state.videoData
                adapter.awaitList(state.videoData)
                }
.
.

VideoPagerViewModel (🗝 Already Present)
internal class VideoPagerViewModel(
    private val repository: VideoDataRepository,
    private val appPlayerFactory: AppPlayer.Factory,
    private val handle: PlayerSavedStateHandle,
    initialState: ViewState,
) : MviViewModel<ViewEvent, ViewResult, ViewState, ViewEffect>(initialState) {

    override fun onStart() {
        processEvent(LoadVideoDataEvent)
    }

    override fun Flow<ViewEvent>.toResults(): Flow<ViewResult> {
        // MVI boilerplate
        return merge(
            filterIsInstance<LoadVideoDataEvent>().toLoadVideoDataResults(),
            filterIsInstance<PlayerLifecycleEvent>().toPlayerLifecycleResults(),
            filterIsInstance<TappedPlayerEvent>().toTappedPlayerResults(),
            filterIsInstance<OnPageSettledEvent>().toPageSettledResults(),
            filterIsInstance<PauseVideoEvent>().toPauseVideoResults()
        )
    }

    private fun Flow<LoadVideoDataEvent>.toLoadVideoDataResults(): Flow<ViewResult> {
        return flatMapLatest { repository.videoData() }
            .map { videoData ->
                val appPlayer = states.value.appPlayer
                // If the player exists, it should be updated with the latest video data that came in
                appPlayer?.setUpWith(videoData, handle.get())
                // Capture any updated index so UI page state can stay in sync. For example, a video
                // may have been added to the page before the currently active one. That means the
                // the current video/page index will have changed
                val index = appPlayer?.currentPlayerState?.currentMediaItemIndex ?: 0
                LoadVideoDataResult(videoData, index)
            }
    }
.
.
.
}

VideoDataSource (🆕 Added)
class VideoDataSource(private val videoDao: VideosDao?) : PagingSource<Int, VideoData>() {

    override fun getRefreshKey(state: PagingState<Int, VideoData>): Int? {
        return state.anchorPosition?.let { anchorPosition ->
            val anchorPage = state.closestPageToPosition(anchorPosition)
            anchorPage?.prevKey?.plus(1) ?: anchorPage?.nextKey?.minus(1)
        }
    }

    override suspend fun load(params: LoadParams<Int>): LoadResult<Int, VideoData> {
        val page = params.key ?: 0

        return try {
            val videos = videoDao?.getPaginatedShorts(params.loadSize, page * params.loadSize)
                ?: emptyList()
            LoadResult.Page(
                data = videos,
                prevKey = if (page == 0) null else page - 1,
                nextKey = if (videos.isEmpty()) null else page + 1
            )
        } catch (e: Exception) {
            LoadResult.Error(e)
        }
    }
}

PagerPagingAdapter (🆕 Added)
internal class PagerPagingAdapter(private val imageLoader: ImageLoader) :
    PagingDataAdapter<VideoData, PageViewHolder>(VideoDataDiffCallback) {

    private var recyclerView: RecyclerView? = null

    // Extra buffer capacity so that emissions can be sent outside a coroutine
    private val clicks = MutableSharedFlow<Unit>(extraBufferCapacity = 1)

    fun clicks() = clicks.asSharedFlow()

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PageViewHolder {
        return LayoutInflater.from(parent.context)
            .let { inflater -> ShortsPageItemBinding.inflate(inflater, parent, false) }
            .let { binding ->
                PageViewHolder(binding, imageLoader) { clicks.tryEmit(Unit) }
            }
    }

    override fun onBindViewHolder(holder: PageViewHolder, position: Int) {
        getItem(position)?.let(holder::bind)
    }

    override fun onAttachedToRecyclerView(recyclerView: RecyclerView) {
        this.recyclerView = recyclerView
    }

    override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) {
        this.recyclerView = null
    }

    /**
     * Attach [appPlayerView] to the ViewHolder at [position]. The player won't actually be visible in
     * the UI until [showPlayerFor] is also called.
     */
    suspend fun attachPlayerView(appPlayerView: AppPlayerView, position: Int) {
        awaitViewHolder(position).attach(appPlayerView)
    }

    // Hides the video preview image when the player is ready to be shown.
    suspend fun showPlayerFor(position: Int) {
        awaitViewHolder(position).hidePreviewImage()
    }

    suspend fun renderEffect(position: Int, effect: PageEffect) {
        awaitViewHolder(position).renderEffect(effect)
    }

    /**
     * The ViewHolder at [position] isn't always immediately available. In those cases, wait for
     * the RecyclerView to be laid out and re-query that ViewHolder.
     */
    private suspend fun awaitViewHolder(position: Int): PageViewHolder {
        if (itemCount == 0) error("Tried to get ViewHolder at position $position, but the list was empty")

        var viewHolder: PageViewHolder?

        do {
            viewHolder = recyclerView?.findViewHolderForAdapterPosition(position) as? PageViewHolder
        } while (currentCoroutineContext().isActive && viewHolder == null && recyclerView?.awaitNextLayout() == Unit)

        return requireNotNull(viewHolder)
    }

    private object VideoDataDiffCallback : DiffUtil.ItemCallback<VideoData>() {
        override fun areItemsTheSame(oldItem: VideoData, newItem: VideoData): Boolean {
            return oldItem.id == newItem.id
        }

        override fun areContentsTheSame(oldItem: VideoData, newItem: VideoData): Boolean {
            return oldItem == newItem
        }
    }
}

@nihk can you please help here?

hi @Meet-Miyani. i'm not familiar with the androidx.paging library, unfortunately. in my opinion, it's a library one should avoid using unless your use case is handling hundreds of thousands of records in a database table.
but to your question: VideoViewModel.toLoadVideoDataResults() is where the video data is loaded from. you could change object LoadVideoDataEvent to instead be something like data class LoadVideoDataEvent(val page: Int = 1) and forward the page value to your VideoDataRepository implementation.
upstream the UI can call viewModel.processEvent(LoadVideoDataEvent(page = ...)) once it reaches the last video in the list.
in VideoViewModel.reduce() for LoadVideoDataResult you'll want to append the videoData to the current state's videoData instead of outright replacing it.

I see, seems a bit difficult for me @nihk But I'll give a sure try! Thanks for considering my issue ❤
Actually yes, I have to use the paging library as I have thousands of videos in my db, and handling all at once take some time like 3 to 4 secs for the viewpager to setup.
Again thanks a lot. If you don't mind can I reach back to you in case I couldn't figure it out?

no problem. let me know how it goes!

Hey @nihk , seems like it did work, but still I am messing up something, maybe with concatenation of old and new data.
I've taken pageSize as 5 for checking it faster. Will increase it later
Let me show you the code changes,
VideoDataRepository
interface VideoDataRepository {
    fun videoData(page: Int): Flow<List<VideoData>>
}

ShortVideoDataRepository
class ShortVideoDataRepository(private val context: Context) : VideoDataRepository {
    override fun videoData(page: Int): Flow<List<VideoData>> {
        return ViewTubeDatabase.getInstance(context).shortsDao().getPaginatedShorts(5, page)
            .map { shorts ->
                shorts.map { short ->
                    VideoData(
                        short.id,
                        Uri.parse(short.uri),
                        short.path,
                        short.aspectRatio,
                        short.duration
                    )
                }
            }
    }
}

ShortsFragment
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        val binding = FragmentShortsBinding.bind(view)
        // This single player view instance gets attached to the ViewHolder of the active ViewPager page
        val appPlayerView = appPlayerViewFactory.create(view.context)

        val adapter = PagerAdapter(imageLoader)
        binding.shortPager.adapter = adapter
        binding.shortPager.offscreenPageLimit = 1 // Preload neighbouring page image previews

        val states = viewModel.states
            .onEach { state ->
                .
                .
                .
                 // Restore any saved page state from process recreation and configuration changes.
                // Guarded by an isIdle check so that state emissions mid-swipe or during page change
                // animations are ignored. There would have a jarring page-change effect without that.
                if (binding.shortPager.isIdle) {
                    binding.shortPager.setCurrentItem(state.page, false)
                    state.videoData?.let {
                        if (state.page > it.lastIndex - 2) {
                            val page = it.size / 5
                            viewModel.processEvent(LoadVideoDataEvent(page)) // -- need help here as well
                        }
                    }
                }
.
.
.
    }

VideoPagerViewModel
internal class VideoPagerViewModel(
    private val repository: VideoDataRepository,
    private val appPlayerFactory: AppPlayer.Factory,
    private val handle: PlayerSavedStateHandle,
    initialState: ViewState,
) : MviViewModel<ViewEvent, ViewResult, ViewState, ViewEffect>(initialState) {

    override fun onStart() {
        processEvent(LoadVideoDataEvent())
    }

    override fun Flow<ViewEvent>.toResults(): Flow<ViewResult> {
        // MVI boilerplate
        return merge(
            filterIsInstance<LoadVideoDataEvent>().toLoadVideoDataResults(),
            filterIsInstance<PlayerLifecycleEvent>().toPlayerLifecycleResults(),
            filterIsInstance<TappedPlayerEvent>().toTappedPlayerResults(),
            filterIsInstance<OnPageSettledEvent>().toPageSettledResults(),
            filterIsInstance<PauseVideoEvent>().toPauseVideoResults()
        )
    }

    private fun Flow<LoadVideoDataEvent>.toLoadVideoDataResults(): Flow<ViewResult> {
        return flatMapLatest { repository.videoData(it.page) }  // <------  sent the page here
            .map { videoData ->
                val appPlayer = states.value.appPlayer
                // If the player exists, it should be updated with the latest video data that came in
                appPlayer?.setUpWith(videoData, handle.get())
                // Capture any updated index so UI page state can stay in sync. For example, a video
                // may have been added to the page before the currently active one. That means the
                // the current video/page index will have changed
                val index = appPlayer?.currentPlayerState?.currentMediaItemIndex ?: 0
                LoadVideoDataResult(videoData, index)
            }
    }

    override fun ViewResult.reduce(state: ViewState): ViewState {
        // MVI reducer boilerplate
        return when (this) {
            is LoadVideoDataResult -> {  // ---- need help here, maybe problem with joining the 2 lists.
                val videos = arrayListOf<VideoData>()
                state.videoData?.let { videos.addAll(it) }
                videos.addAll(videoData)
                state.copy(
                    videoData = videos,
                    page = currentMediaItemIndex
                )
            }

            is CreatePlayerResult -> state.copy(appPlayer = appPlayer)
            is TearDownPlayerResult -> state.copy(appPlayer = null)
            is OnNewPageSettledResult -> state.copy(page = page, showPlayer = false)
            is OnPlayerRenderingResult -> state.copy(showPlayer = true)
            is AttachPlayerToViewResult -> state.copy(attachPlayer = doAttach)
            else -> state
        }
    }
}

i think in toLoadVideoDataResults is where you should be combining the videoData, not reduce(), e.g.
    private fun Flow<LoadVideoDataEvent>.toLoadVideoDataResults(): Flow<ViewResult> {
        return flatMapLatest { repository.videoData(it.page) }  // <------  sent the page here
            .map { videoData ->
                val combinedVideoData = states.value.videoData.orEmpty() + videoData
                val appPlayer = states.value.appPlayer
                // If the player exists, it should be updated with the latest video data that came in
                appPlayer?.setUpWith(combinedVideoData , handle.get())
                // Capture any updated index so UI page state can stay in sync. For example, a video
                // may have been added to the page before the currently active one. That means the
                // the current video/page index will have changed
                val index = appPlayer?.currentPlayerState?.currentMediaItemIndex ?: 0
                LoadVideoDataResult(combinedVideoData , index)
            }
    }

i'd forgotten about the appPlayer?.setUpWith part

                    state.videoData?.let {
                        if (state.page > it.lastIndex - 2) {
                            val page = it.size / 5
                            viewModel.processEvent(LoadVideoDataEvent(page)) // -- need help here as well
                        }
                    }

this part shouldn't be in the viewModel.states.onEach block; you should send events as a side effect of the page changes.
also in hindsight, avoid duplicating the variable name page for the individual page and the broader cursor page; it'll get confusing mixing up the two different uses. maybe something like cursorPage for the latter.
adding something like this will probably work:
    private fun Flow<LoadVideoDataEvent>.toLoadVideoDataResults(): Flow<ViewResult> {
        return filter { event -> states.value.videoData == null || event.page == states.value.videoData.orEmpty().lastIndex }
         .flatMapLatest { event -> repository.videoData(event.cursorPage) }

might want to use flatMapConcat instead of flatMapLatest too, to avoid accidentally discarding downstream event processing

another approach instead of the above is to manage the current page state within your VideoDataRepository implementation, and simply call something like VideoDataRepository.nextPage() when desired conditions are met in toPageSettledResults. this'd work because VideoDataRepository.videoData() returns a stream and not a 1-shot function

I see, sorry to come up again. I really naive with the flows and the architecture you implemented in this. Thanks again for helping this much 🙏🏽

I removed the logic of changing page separate as you instructed.
Moved the code from reduce to toLoadVideoDataResults

See, here
binding.shortPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
            override fun onPageSelected(position: Int) {
                super.onPageSelected(position)
                if (position > adapter.currentList.lastIndex - 1) {
                    val page = adapter.currentList.size / 5
                    viewModel.processEvent(LoadVideoDataEvent(page))
                }
            }
        })

private fun Flow<LoadVideoDataEvent>.toLoadVideoDataResults(): Flow<ViewResult> {
        return filter { event ->
            Log.d("Shorts_Fragment", "states.value.videoData: ${states.value.videoData}")
            Log.d("Shorts_Fragment", "event.page: ${event.page}")
            Log.d("Shorts_Fragment", "states.value.videoData.orEmpty().lastIndex: ${states.value.videoData.orEmpty().lastIndex}")
            states.value.videoData == null || event.page == states.value.videoData.orEmpty().lastIndex
        }.flatMapLatest { event ->
            Log.d("Shorts_Fragment", "states.value.cursorPage + 1: ${states.value.cursorPage + 1}")
                repository.videoData(states.value.cursorPage + 1)
            }
            .map { videoData ->
                val combinedVideoData = states.value.videoData.orEmpty() + videoData
                val appPlayer = states.value.appPlayer
                // If the player exists, it should be updated with the latest video data that came in
                appPlayer?.setUpWith(combinedVideoData, handle.get())
                // Capture any updated index so UI page state can stay in sync. For example, a video
                // may have been added to the page before the currently active one. That means the
                // the current video/page index will have changed
                val index = appPlayer?.currentPlayerState?.currentMediaItemIndex ?: 0
                LoadVideoDataResult(videoData, index)
            }
    }

Check the logs, seems like it is able to load the next page results, I guess.
Logs:

states.value.videoData: null

event.page: 0

states.value.videoData.orEmpty().lastIndex: -1

states.value.cursorPage + 1: 1

states.value.videoData: [VideoData(id=1000177944, mediaUri=content://media/external/video/media/1000177944, previewImageUri=/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Video/VID-20240228-WA0038.mp4, aspectRatio=0.5625, videoDuration=15070), VideoData(id=1000177778, mediaUri=content://media/external/video/media/1000177778, previewImageUri=/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Animated Gifs/VID-20240228-WA0013.mp4, aspectRatio=1.7931035, videoDuration=4230), VideoData(id=1000173921, mediaUri=content://media/external/video/media/1000173921, previewImageUri=/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Animated Gifs/VID-20240211-WA0038.mp4, aspectRatio=1.3333334, videoDuration=2100), VideoData(id=1000177647, mediaUri=content://media/external/video/media/1000177647, previewImageUri=/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Animated Gifs/VID-20240228-WA0001.mp4, aspectRatio=1.0, videoDuration=980), VideoData(id=1000177558, mediaUri=content://media/external/video/media/1000177558, previewImageUri=/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Video/VID-20240227-WA0007.mp4, aspectRatio=0.55833334, videoDuration=4565)]

event.page: 1

states.value.videoData.orEmpty().lastIndex: 4

Hey @nihk, please help here brother!

Hello @nihk is there any update? If you have some free time, I will appreciate your help here, Thanks!


CFFL

CFFL

Linter check found the following problems:
The following problems have been found:
ERROR: /tmp/abs_9c_0sd32_d/clone/recipe/meta.yaml:18: pip_install_args: pip install should be run with --no-deps.
ERROR: /tmp/abs_9c_0sd32_d/clone/recipe/meta.yaml:23: missing_wheel: For pypi packages, wheel should be present in the host section
ERROR: /tmp/abs_9c_0sd32_d/clone/recipe/meta.yaml:46: missing_license_family: The recipe is missing the about/license_family key.
ERROR: /tmp/abs_9c_0sd32_d/clone/recipe/meta.yaml:46: missing_dev_url: The recipe is missing a dev_url
WARNING: /tmp/abs_9c_0sd32_d/clone/recipe/meta.yaml:46: missing_description: The recipe is missing a description
ERROR: /tmp/abs_9c_0sd32_d/clone/recipe/meta.yaml:46: missing_documentation: The recipe is missing a doc_url or doc_source_url
Errors were found


Powersaving with flywheels

After the driver has shot the note, the command received sets the speed to 0. If the flywheel is spinning at that time, the motor controller will apply power to stop the flywheel. There is no competitive benefit for stopping the flywheel since it will have to be spun up again to shoot.
Recommend expanding the function to include a boolean value along with the target setpoint. The boolean should represent states of shoot and rest. The target setpoint is the flywheel speed for shooting at the current distance to target. When the flywheel is shooting, the motor controller should be set to the target reference velocity. When the flywheel is not shooting, power applied should be 0.
This robot's flywheel does not have a large inertia, so spin up time is low. For a flywheel with large inertia and high spin up time, we would want to maintain a rest velocity.
This robot will have a larger range for shooting. Will the shooting velocity be constant regardless of the distance to target or will it vary over the shooting range?
https://github.com/koibots8230/RumbleBot2024/blob/62df01fcafb80018675651ec7a72f0eea305d9dc/RumbleBot2024/src/main/java/frc/robot/subsystems/Shooter.java#L151

made it so that the min and max moter output range is 0 so it should slowly spin down when not in use


fix: update CSI sidecars used with mayastor CAS-651

Update for bug fixes
csi-provisioner 1.6.0 -> 2.1.0
csi-attacher 2.2.0 -> 3.1.0
E2E:
Re-enable the checks for mayastor pods on uninstall
Turn off the topology feature gate,
this will be addressed in the future.

bors merge

bors merge


Clarify deprecation of scope as a type constraint

scope for allocating classes on the stack is listed as a deprecated feature.  However, no work to actually deprecate it has ever been done, and now with DIP1000, it appears it is no longer deprecated.  In fact it is currently used in DMD's source code.
Here are just a few examples

https://github.com/dlang/dmd/blob/9da5c2dcac4f096dc90551fc92a97b810389a9b4/src/dmd/argtypes.d#L480
https://github.com/dlang/dmd/blob/9da5c2dcac4f096dc90551fc92a97b810389a9b4/src/dmd/arrayop.d#L245
https://github.com/dlang/dmd/blob/9da5c2dcac4f096dc90551fc92a97b810389a9b4/src/dmd/blockexit.d#L542

It's very confusing, and should either be removed from the deprecations page, or sufficiently clarified.  This PR assumes the former is where the leadership is going with this, but I'm not entirely sure.
@WalterBright and @andralex, if you could chime in on this PR and clarify where you intend to go with scope and DIP1000, it would be most welcome.

scope as a pseudo-type-modifier is quite simple; it just requires all variables of that class to be scope

Which will make such classes somewhat incompatible with safe RC/Uniq.
As said earlier, there is hardly a strong use-case to force every user of a class to stack-only allocated instances, and it remains problematic to commit to certain semantics of the scope keyword while we're in a major rework of the semantics of exactly that keyword.
I'm currently preparing a DIP and a proposal for dconf on limited lifetimes, but progress depends somewhat on the time I don't have to spent maintaining the wider ecosystem.

I can't continue work on safeD until we remove the ambiguity about where we're headed.

What are your plans there? We should likely chat/talk if you plan to do some major work in this area.

My view is:

Deprecate scope class C { }. It's kind of a bizarre, neglected quirk. It forces all allocations of C to go on the stack. It's hard to see what the point of it is these days.

Retain scope C c = new C();. The C gets allocated on the stack instead of the heap, but pedantically this is an optimization. The -dip1000 checks ensure it works in that c is not allowed to escape the lifetime of its stack frame.

Thank you @WalterBright for clarifying.  I've updated this PR to reflect your view.
This PR is ready for additional scrutiny and potentially a merge.

Thanks @JinShil and sorry for the time taken.


Cloudflare R2 append SignatureDoesNotMatch

append seems to fail when using the S3 backend with Cloudflare R2 with a SignatureDoesNotMatch error.
To reproduce, create a bucket in R2 together with an API key and use the following environment variables:
OPENDAL_S3_TEST=true
OPENDAL_S3_BUCKET=<bucket-name>
OPENDAL_S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
OPENDAL_S3_ACCESS_KEY_ID=<access-key-id>
OPENDAL_S3_SECRET_ACCESS_KEY=<secret-access-key>
OPENDAL_S3_REGION=auto

The region is required as explained in #912.
Running the s3 tests next results in:
[2023-03-19T13:50:12Z ERROR opendal::services] service=s3 operation=Writer::append path=ebd6275c-8ad7-498c-8eae-baaef2f4c303 written=0 -> data write failed: PermissionDenied (permanent) at Writer::append => S3Error { code: "SignatureDoesNotMatch", message: "The request signature we calculated does not match the signature you provided. Check your secret access key and signing method.", resource: "", request_id: "" }

    Context:
        response: Parts { status: 403, version: HTTP/1.1, headers: {"date": "Sun, 19 Mar 2023 13:50:27 GMT", "content-type": "application/xml", "content-length": "234", "connection": "keep-alive", "server": "cloudflare", "cf-ray": "7aa62f3b5d6628ac-AMS"} }
        service: s3
        path: ebd6275c-8ad7-498c-8eae-baaef2f4c303

All other tests succeed.

I'll take a look, thanks for report.

This issue has been addressed in https://github.com/apache/incubator-opendal/pull/1690. Additionally, we will be implementing integration tests for R2 to prevent similar problems from occurring again. Tracked at https://github.com/apache/incubator-opendal/issues/1691.

Thanks for the quick fix!


Manga no Sekai broke again

Source information
Manga no Sekai 1.4.50
Source language
Spanish
Steps to reproduce
Try to update list
Get error ! Expected URL scheme 'http' or 'https' but no scheme was found
Expected behavior
Successfully retrieve new Manga chapters
Actual behavior
! Expected URL scheme 'http' or 'https' but no scheme was found
Mihon/Tachiyomi version
0.16.5
Android version
Android 13
Other details

Acknowledgements

[X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
[X] I have written a short but informative title.
[X] I have updated the app to version 0.15.3.
[X] I have updated all installed extensions.
[X] I have tried the troubleshooting guide.
[X] If this is an issue with the app itself, I should be opening an issue in the app repository.
[X] I will fill out all of the requested information in this form.

These ones, particularly. Wierd stuff because webview works now that I check yet trying to update them results in said error

Edit: scratch that. I retried now and they don't give the error anymore. Weird stuff

maybe the site was down for a moment, you can check by changing the chapter list page, if it doesn't load, it's a site issue

Edit: scratch that. I retried now and they don't give the error anymore. Weird stuff

maybe the site was down for a moment, you can check by changing the chapter list page, if it doesn't load, it's a site issue

That was the weird part, I checked the webview and it was fine yet trying to do an update displayed a flair with said error. After opening the issue I didn't checked again because it was supposed to be related to site status since it was never down. It puzzles me but dunno, in case of that error popping up again I'll record a video to better showcase what steps I took to ensure site status, it may be of use if by any means this becomes a thing


VX_NN - Updates

Model Compiler - Updates
CMakeList - Link Updates

@LakshmiKumar23 -- running ONNX tests from runNeuralNetworkTests.py successfully with this PR
onnx-squeezenet - Batch size 1
loading ONNX model from /workspace/MIVisionX/tests/neural_network_tests/models/onnx-squeezenet/model.onnx ...
converting to IR model in . ...
OK: creating IR description in ./graph.nnir ...
OK: creating IR binaries in ./binary ...
reading IR model from . ...
OK: reading IR description from ./graph.nnir ...
OK: reading IR binaries from ./binary ...
writing IR model into . ...
OK: creating IR description in ./graph.nnir ...
OK: creating IR binaries in ./binary ...
reading IR model from . ...
OK: reading IR description from ./graph.nnir ...
OK: reading IR binaries from ./binary ...
#OUTPUT-TENSOR: softmaxout_1 1 1000 1 1
creating C code in . ...
creating ./CMakeLists.txt ...
creating ./cmake/FindOpenCL.cmake ...
creating ./annmodule.h ...
creating ./annmodule.cpp ...
creating ./weights.bin ...
creating ./anntest.cpp ...
creating ./annpython.h ...
creating ./annpython.cpp ...
creating ./anntest.py ...
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenCL - Setting CL_TARGET_OPENCL_VERSION=220
-- Using OpenCL Library -- /opt/rocm/opencl/lib/libOpenCL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/MIVisionX/tests/neural_network_tests/models/develop/onnxNoFuse/nnir_build_1
Scanning dependencies of target annmodule
[ 16%] Building CXX object CMakeFiles/annmodule.dir/annmodule.cpp.o
[ 33%] Linking CXX shared library libannmodule.so
[ 33%] Built target annmodule
Scanning dependencies of target annpython
[ 50%] Building CXX object CMakeFiles/annpython.dir/annpython.cpp.o
[ 66%] Linking CXX shared library libannpython.so
[ 66%] Built target annpython
Scanning dependencies of target anntest
[ 83%] Building CXX object CMakeFiles/anntest.dir/anntest.cpp.o
[100%] Linking CXX executable anntest
[100%] Built target anntest
onnx-squeezenet - Batch size 1
OK: loaded 39 kernels from libvx_nn.so
OK: OpenVX using GPU device#0 (gfx906:sramecc+:xnack-) [OpenCL 2.0 ] [SvmCaps 0 0]
OK: graph initialization with annAddToGraph() took 3549.326 msec
OK: vxProcessGraph() took 2107.912 msec (1st iteration)
OK: vxProcessGraph() took 1.434 msec (average over 100 iterations)
OK: OpenCL buffer usage: 14954048, 58/58
OK: successful


[Package - General] The structure

We should invest some time to decide which Python module structure we will follow when we build the package.
We have two options:

src layout
flat layout

Both are described here (short): src layout vs flat layout
Pros and cons of both in detail: Python Package Structure for Scientific Python Projects
I've used the flat layout every time. Why? Because almost all scientific Python packages use it ;) The src layout is more common in business environments. I'd choose the src layout this time, but what do you think about it? Do you know any issues we may encounter using the src layout?

I dont think we can meet any issues using src layout however I think python packages mostly use flat structure approach.

@SimonMolinsky as you mentioned. I think flat structure is better because we will have a lot examples from other packages (for me it will be very helpful)

Decision
After a few discussions we decided to move towards src package architecture - easier tests run, and more popular approach.


Crashing app just by requiring the gcloud module v0.13.2

I have started to migrate our file storage strategy to use Google Cloud Storage. I have installed the module from npm into my project like so:
npm install gcloud --save
Then I only required it at the top of a file to use within like so:
var gcloud = require('gcloud');
When I start the app it crashes immediately with ...terminated by signal SIGILL (Illegal instruction)
When I remove the require statement then my app goes back to operating as normal.
Any idea? Is it just this version (v0.13.2)?
EDIT: I am locally using OSX Yosemite 10.10.2 and Node.js v0.12.2 (tried it on v0.12.0 with same results)

Might be related to #425

Can you try to reproduce this on master? I believe we may have fixed it.

Yes. I confirm that the latest change on master fixed this issue on my environment as stated above.

Awesome! Thank you!


[proposal] Make explicit that MODULE's value changes when inside definst/3

Calling definst/3's  body inside  defimpl breaks the semantics  of __MODULE__  (is this  the proper way to say it?).
For example,
defmodule Name do
  import Algae
  import TypeClass
  use Witchcraft

  defdata do
    name :: String.t()
  end

  definst Witchcraft.Functor, for: __MODULE__ do
    @force_type_instance true

    def map(%__MODULE__{name: name}, f) do
      __MODULE__.new(name)
    end
  end
end

will result in
** (CompileError) lib/instance/assword.ex:13:
Witchcraft.Functor.Proto.Instance.Name.__struct__/0 is undefined,
cannot expand struct Witchcraft.Functor.Proto.Instance.Name

I know that map/2 above could've been defined as
def map(%{name: name}), do: Name.new(name)

or a long name could be aliased, but it is not intuitive, and I don't think this behaviour is documented. (That is, I remember some mention of it, but couldn't find that passage again.)

The two commits below are just suggestions:

16f7857 - add a module attribute
ad4fbbb - make this behaviour explicit in docs

Thanks! I think this __MODULE__ stuff is breaking stuff in 1.9, this helps clear things up 👍


MM-12141 Switching broken image error text to icon.

How it looks (ignore the error bar):

Comparison to how it looks on webapp (Firefox):

Not convinced this is an improvement over the current behavior:

If we want it bigger or red I can do that.

@crspeller
Should look something like this, attaching it in the center channel along with the svg.
error-svg.zip

@asaadmahmood can we try and avoid and svg, it is super slow to render SVG's in the mobile app, perhaps a png?

@asaadmahmood Awaiting answer to @enahum question.

@crspeller can you please help implement the PNG icons above?

Updated!
It now looks like this:


Test coverage display when re-running single tests

Testing #199242
The experience is looking great! I noticed a few things that I'm not sure if they're as designed or not:

I expected to still be able to see the test2.md coverage when I re-ran the single test case on test.md, but it disappears.
Once you re-run a single test case, it seems the denominator of the coverage does not change, so that causes the coverage to go down significantly, unless you re-run all tests again:

This isn't something we can do much about as an editor. Users running coverage for a single test should be aware that the coverage report will only reflect that single test.


Is there a work around for the CORS issue?

I'm currently trying to implement Yelp into a React application and I am receiving a CORS error trying to access Yelp from the client-side. Do you know of any possible way to work around this?

I will have to look into using JSONP or potentially rethinking the small project. I was using ReactJS, React-Router, and Request-Promise (to get Yelp Information).

What kind of project are you working on?
While JSONP will get you there, it's kind of a hack, so unless you're just playing around I wouldn't recommending going that route. Yelp's api intentionally disabled cross origin requests, so I think the right thing to do is write a server-side endpoint that will relay the request -- this endpoint will have to be hosted on the same domain as your frontend or hosted on a different domain but return a CORS header that allow requests from your frontend domain.


feature request.

we copy paste in chat to keep in mind the duration of the summoner spells, but sometimes we need to use translator etc. to communicate more properly with the team and this is where the confusion comes in, when you do ctrl v it gives like this:
flash 900 [text from clipboard]

Hi :D
I just added the ability to customize your keybinds, download the newest version of the program and check it out.
Thanks for the suggestion

No problem, enjoy! ^^


use which to resolve codemod path

Closes #184
@bendemboski Do you think this will work? It avoids the complexity in this app.

Doesn't work for me ☹
~/projects/groening$ ember-cli-update
/Users/ben/.config/yarn/global/node_modules/which/which.js:134
  throw getNotFoundError(cmd)
  ^

Error: not found: ember-modules-codemod
    at getNotFoundError (/Users/ben/.config/yarn/global/node_modules/which/which.js:13:12)
    at Function.whichSync [as sync] (/Users/ben/.config/yarn/global/node_modules/which/which.js:134:9)
    at Object.<anonymous> (/Users/ben/.config/yarn/global/node_modules/ember-cli-update/src/index.js:15:34)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
~/projects/groening$

Maybe because ember-modules-codemod isn't set up to publish its binary to .bin?

@kellyselden - I didn’t fully follow the discussion in the issue, but any reason to avoid using execa here? It supports invoking binaries from installed npm packages out of the box (and returns a promise)...

@rwjblue the issue here has to do with to what level ember-modules-codemod is hoisted. You can end up with this directory structure wherever you have ember-cli-update installed:
node_modules
 └── ember-cli-update
     └── node_modules
         └── ember-modules-codemod

or this one:
node_modules
 ├── ember-cli-update
 └── ember-modules-codemod

Since ember-modules-codemod doesn't have a main, we can't just require.resolve it to find the path to it, and when it gets installed as a dependency of ember-cli-update (at least on my system, using the latest yarn global add), its binary doesn't end up getting symlinked into my path.
That's what we're grappling with here. The most robust solution I can think of would be to give ember-modules-codemod a main that allows API invocation, but I don't know how straightforward that would be.
Regardless, I'm personally a big fan of execa :)

I was referring to using execa's preferlocal option (documented here) which should resolve the binary automatically just like a npm script would.  I still think that should work fine?


fix(fit-to-center): fix calculation

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

npm package (@latest dist-tag)
npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Adding 4 additional sites

Wow these all look really slick.
Thanks Josh.

BTW since all the sites from your company clearly have had a professional designer work on them, feel free to always include them as "featured sites" simply by including a trailing slash in their URLs. I don't think there's been a single site from your company that hasn't been featured that way since they all look slick.
Thanks again!

Eg: 2f37a16f4064662284dfce482035d55f6945bb2f


More Option

Issue without proper information won't be answered
Expected Behavior
I would like more option, more button like a "return home" button or more settings.
Actual Behavior
there is not a lot of button/settings.
Information

Mac OS X El Capitan

If you want to edit the bot's configuration, you can right click on the app, click view package contents, then navigate to Contents, Resources, App, gofbot, configs and then edit the config.json file with textedit. Make sure that any quotation marks you work around don't change to smart quotes. Looks like that's your only option at this time.


Implement qualitative text for ALFRESCO data (relative flammability and vegetation change)

Hold off on the vegetation change until we get more details from the group!


OutputStream Problems in Extending Storage

When I expand the underlying storage, I find that I write 8192B every time. Is that correct?

@DPnice can you clarify your questions?

how do you expand the underlying storage? What's the storage?
"I find I write 8192B every time" -> Who writes this 8192B? Client or the worker? What's the workload generator?  I don't think Alluxio worker wrote such a small amount of data to UFS each time. Is it possible from the user-side logic?

The underlying storage is seaweedfs
extends BaseUnderFileSystem
Using a single node

cmd:
$ /alluxio/bin/alluxio fs persist /test2.txt

Some worker log：
2018-12-25 14:27:33,718 INFO  SeaweedfsOutputStream - 当前长度: 56803328
2018-12-25 14:27:33,738 INFO  SeaweedfsOutputStream - write(byte[] b, int off, int len)当前长度:56811520
2018-12-25 14:27:33,738 INFO  SeaweedfsOutputStream - 当前长度: 56811520
2018-12-25 14:27:33,799 INFO  SeaweedfsOutputStream - write(byte[] b, int off, int len)当前长度:56819712

You can see 8192B data written at a time.

@DPnice thanks for the update. I checked the Alluxio source code and I actually find there is a small buffer of 16KB is allocated for persist command (link). This can be an issue if you need very fast persist implementation. I will create an issue to address this.


History not refreshing when scanning a new product

What

History not refreshing when scanning a new product

This issue still or again exists, when you create a new product (at least via search)


Literature review

There are already a number of guidance documents, governance frameworks, security checklists and more. Within AI Readiness we'd like to conduct a thorough literature review, cataloguing and summarising the documentation that is already present. This will:

Raise awareness of relevant and important documentation
Help us avoid re-inventing the wheel when creating our own governance framework, see #10

Model Openness Framework
AI Alliance

The AI Alliance will begin its work with the formation of member-driven working groups ... The Alliance will also establish a governing board and technical oversight committee dedicated to advancing the above project areas, as well as establishing overall project standards and guidelines.
In addition to bringing together leading developers, scientists, academics, students, and business leaders in the field of artificial intelligence, the AI Alliance will plan to partner with important existing initiatives from governments, non-profit and civil society organizations who are doing valuable and aligned work in the AI space.

https://aisafetyfundamentals.com
Referencing Shared responsibility model in cloud might also be useful to help understand AI security accountability
Is the scope Safety = Security + best practices or Safety = Security ? resources might vary based on the AI safety scope


Create vitbstudent.txt

VIT University, Bangalore
VIT Bangalore
.group
The official website of VIT Bangalore: https://vitbangalore.in/

@itzshivam1999 I have to close this request without merging, because you requested to add a non-existent domain to this repository: Host vitbstudent.edu.in not found: 3(NXDOMAIN) Please ensure that you are familiar with this repository rules located at the bottom of this page and submit a new request with the correct information. Thank you for your understanding!


feature: compare local pids

For a feature in a library we're writing we wanted to compare LocalPids without encoding/decoding them into Terms. For this I thought the process was simple:

Add nif_compare_pids to rustler_sys (by adding a b.func under the appropriate version). See: enif_compare_pids
Implement PartialEq/Eq/PartialOrd/Ord for LocalPid
Write some tests

However, when I'm running all the test suites (specifically the rustler_tests one by calling mix test) I'm now running into:
{:error,
 {:load_failed,
  ~c"Failed to load NIF library: 'dlopen(/Users/maxh/Development/rustler/rustler_tests/_build/test/lib/rustler_test/priv/native/librustler_test.so, 0x0002): symbol not found in flat namespace '_enif_compare_pids''"}}

I know this implies it cannot find the symbol in the erlang libs, but I was unable to find the location where the libraries are included to figure out which specific symbol I should be including.
Hence two questions:

Would you want to include this feature for LocalPid?
If so: could somebody help to point me in the right direction to make sure I'm referencing the right symbol?

Additional information:

I'm running OSX
If I switch back to the master branch (and clear all /target, /_build folders) I can run the tests without issues.

I believe enif_compare_pids is not a function, but a macro. Thus, there isn't a symbol for it.

Welp, that is a bit silly from me. Before I "found" that enif_compare_pids I hopped through a lot of C macros to figure out what enif_compare was doing under the hood. But at no point did I consider the possibility that my missing symbol would be missing because it was actually a macro... Would you still accept the PR if I would implement the comparisons?
I have two options. Note that Term::cmp calls enif_compare using Term::as_c_arg as the arguments. That c_arg, looking at LocalPid::encoder, is equal to pid::make_pid(env.as_c_arg(), self.c). Which is an alias for enif_make_pid, which is actually manually implemented to just return the ErlNifPid::pid field, without referring to the Env.
So, if you would allow this, we could:

drop the env argument to pid::make_pid and enif_make_pid. So we may call enif_compare directly (but it is a bit ugly, as we're no longer following the interface as specified in the erlang documentation).
Hardcode a enif_compare_pids, just like enif_make_pid, which would simply call enif_compare with the internal ErlNifPid::pid field. Just like the C macro does in the link you provided.
???

I believe (2) is a reasonable solution. What do you think?

Yes, (2) would be an acceptable solution. I'd rather not have us change interfaces of wrapped functions, there is no guarantee that they won't actually require their parameters at some point.

Looks good to me. We'll have to follow this up with a minor version bump on rustler-sys and a corresponding bump of the dependency in rustler.

Thanks for the quick replies and the nice library!

It's a note for myself, I will do that after this one is merged :). Just waiting for another review from @evnu before merging.


Static site builds fail when running with client-side error TypeError: Cannot redefine property: _currentRenderer

I took the following steps to build the example site and export it as a static site:
yarn create r3f-app next my-app
cd my-app
npm run-script dev  ==> site works fine when browsing to localhost:3000
npm run-script export then http-server out   (after first npm installing http-server globally)
When viewing the page there is a client-side error:
"Application error: a client-side exception has occurred (see the browser console for more information)."
Console output looks like this:
framework-3583eef75b58b7b2.js:1 TypeError: Cannot redefine property: _currentRenderer
    at Function.defineProperties (<anonymous>)

Yes I also have this problem. When deploying to Vercel it also shows this error message.
Application error: a client-side exception has occurred (see the browser console for more information).
Did you get anywhere with this @ivyroot?

@ivyroot - I would use this instead https://github.com/pmndrs/react-three-next

+1 ... Same issue for me.

Downgrading r3f from ^8.8.4 to 8.7.2 fixed this for me

Try updating R3F to latest or upgrading your lockfile and doing a clean install.

This issue should be fixed with the latest r3f version thanks @CodyJasonBennett


several species options for the catch

As a fisherman I would like to be able to set several species options for the catch, to be chosen from when completing form https://github.com/StAResComp/sifids/issues/6, https://github.com/StAResComp/sifids/issues/8

Must


openvswitch-lts: 2.5.9 -> 2.5.12

Motivation for this change
https://nvd.nist.gov/vuln/detail/CVE-2020-27827
https://nvd.nist.gov/vuln/detail/CVE-2020-35498
Someone able to test this properly?
See also #112956
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[ ] NixOS
[ ] macOS
[x] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[x] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 118485 at 079dd989 run on x86_64-linux 1

1 package built successfully:

openvswitch-lts

4 suggestions:

warning: build-tools-in-build-inputs
util-linux is a build tool so it likely goes to nativeBuildInputs, not buildInputs.
Near pkgs/os-specific/linux/openvswitch/lts.nix:23:3:
   |
23 |   buildInputs = [ util-linux openssl libcap_ng python2 perl procps which ];
   |   ^

warning: unused-argument
Unused argument: iproute.
Near pkgs/os-specific/linux/openvswitch/lts.nix:2:40:
  |
2 | , procps, libcap_ng, openssl, python2, iproute , perl
  |                                        ^

warning: build-tools-in-build-inputs
which is a build tool so it likely goes to nativeBuildInputs, not buildInputs.
Near pkgs/os-specific/linux/openvswitch/lts.nix:23:3:
   |
23 |   buildInputs = [ util-linux openssl libcap_ng python2 perl procps which ];
   |   ^

warning: missing-patch-comment
Please add a comment on the line above, explaining the purpose of this patch.
Near pkgs/os-specific/linux/openvswitch/lts.nix:18:15:
   |
18 |   patches = [ ./patches/lts-ssl.patch ];
   |               ^

ping @netixx @kmcopper

@ofborg eval


Simple (flat rate) taxes API

This feature branch contains implementation for the new tax API which will allow defining tax rates per country and tax classes and customize tax configuration per channel.
Progress

[x] Add tax models (#9839).
[x] Add tax API queries (#9856).
[x] Add tax API mutations. (#9934).
[x] Add API to query/update tax classes for products, product types and shipping methods. (#9999)
[ ] Drop Vatlayer. (#10335)
[ ] Add logic to use flat tax rates in internal calculations. (#10121)
[ ] Deprecate old tax API.
[ ] Add integration with apps.
[ ] Add webhook events for tax objects.

General assumptions
Introduce the following concepts:

Tax configuration - a channel-specific configuration that can determine whether:

prices are entered with or without tax
taxes should be charged in the given channel; can be overridden per country
prices returned in the public product API (e.g. for rendering in the storefront) include the tax; can be overridden per country

It's important that tax collection and tax calculation are not the same thing, we may still need to calculate taxes if prices are entered as gross amounts and tax collection is disabled just to know what the amount is. For example: a channel for B2B sales could disable tax collection for all countries.
Tax configuration objects will be created for each existing channel with data migration and for any new channel in the channelCreate mutation.

Tax class - a named object that provides tax rates for specific countries. Product types are assigned to tax classes. Optionally products can override the tax class defined by the product type. Shipping methods can be also assigned to tax classes to define tax rates for shipping. Examples of tax groups: "Default", "Perfume", "Books", "Beer".

When presenting a product price, use the assigned group and user's country to determine if that group has a special rate assigned to it or if the default tax rate of the country is to be used. When calculating the shipping, check if the country has a special tax rate assigned for shipping or if the default tax rate of the country is to be used.
App interaction

Use country tax configuration existence to determine whether to invoke the tax webhook.
If country configuration exists (even if tax collection is disabled for the current channel), use the above logic to calculate taxes and don't call the webhook.
If country configuration doesn't exist, call the synchronous tax webhook
Create tax classes for each tax code assigned to products, copy the tax code to its metadata, and assign those products to the tax class.
Update the Avatax plugin to use tax class metadata to determine the tax code instead of product metadata.

Drop Vatlayer
Vatlayer plugin will be removed after merging these changes as most of its logic will be done be Saleor.
Model changes
 classDiagram

  TaxClass "1" -- "*" TaxClassCountryRate
  TaxClass "1" -- "*" ProductType
  TaxClass "1" -- "*" Product
  TaxClass "1" -- "*" ShippingMethod
  TaxConfig "1" -- "*" TaxConfigPerCountry
  TaxConfig "1" -- "1" Channel

  class TaxClass {
    name: String
    is_default: Boolean
    product_types: [ProductType]
    products: [Product]
    shipping_method: [ShippingMethod]
    metadata: Metadata
}

class TaxClassCountryRate {
    country_code: String
    rate: Number
}

class TaxConfig {
    channel: Channel
    chargeTaxes: Boolean
    displayGrossPrices: Boolean
    pricesEnteredWithTax: Boolean
    metadata: Metadata
}

class TaxConfigPerCountry {
    countryCode: String
    chargeTaxes: Boolean
    displayGrossPrices: Boolean
}

API to manage tax configuration for channels and countries
Deprecated API

Deprecate inputs: ProductCreateInput.chargeTaxes, ProductInput.chargeTaxes
Deprecate current tax settings in the Shop type: includeTaxesInPrices, chargeTaxesOnShipping, displayGrossPrices - will be replaced with new TaxChannelConfiguration type.
Deprecate CountryDisplay.vat

Types
type TaxChannelConfiguration {
  id: ID!
  channel: Channel!
  chargeTaxes: Boolean!
  displayGrossPrices: Boolean!
  pricesEnteredWithTax: Boolean!
  countries: [TaxConfigurationPerCountry!]!
  privateMetadata: [MetadataItem!]!
  privateMetafield(key: String!): String
  privateMetafields(keys: [String!]): Metadata
  metadata: [MetadataItem!]!
  metafield(key: String!): String
  metafields(keys: [String!]): Metadata
}

type TaxConfigurationPerCountry {
  countryCode: String!
  chargeTaxes: Boolean!
  displayGrossPrices: Boolean!
}

type TaxClass {
  id: ID!
  name: String!
  isDefault: Boolean!
  countries: [TaxClassCountryRate!]
  privateMetadata: [MetadataItem!]!
  privateMetafield(key: String!): String
  privateMetafields(keys: [String!]): Metadata
  metadata: [MetadataItem!]!
  metafield(key: String!): String
  metafields(keys: [String!]): Metadata
}

type TaxClassCountryRate {
  countryCode: String!
  taxClass: TaxClass!
  rate: Float!
}

type TaxCountryConfiguration {
  countryCode: String!
  taxClassCountryRates: [TaxClassCountryRate!]!
}

# change existing types:

type ProductPricingInfo {
  displayGrossPrices: Boolean!
}

type Order {
  displayGrossPrices: Boolean!
}

type Checkout {
  displayGrossPrices: Boolean!
}

Queries
All queries require MANAGE_TAXES permission. (For simplicity skipped definitions of connections and filtering and sorting inputs).
type Query {

  taxConfigurations(
    filter: TaxConfigurationFilterInput,
    sortBy: TaxConfigurationSortingInput,
    before: String,
    after: String,
    first: Int,
    last: Int
  ): TaxConfigurationCountableConnection

  taxConfiguration(id: ID!): TaxConfiguration

  taxClasses(
    filter: TaxClassFilterInput,
    sortBy: TaxClassSortingInput,
    before: String,
    after: String,
    first: Int,
    last: Int
  ): TaxClassCountableConnection

  taxClass(id: ID!): TaxClass

  taxCountryConfigurations: [TaxCountryConfiguration!]!

  taxCountryConfiguration(countryCode: CountryCode!): TaxCountryConfiguration!
}

Mutations
All mutations require MANAGE_TAXES permission.
type Mutation {
  taxConfigurationUpdate(id: ID!, input: TaxConfigurationUpdateInput!): TaxConfigurationUpdate!
  taxClassCreate(input: TaxClassCreateInput!): TaxClassCreate!
  taxClassUpdate(id: ID!, input: TaxClassUpdateInput!): TaxClassUpdate!
  taxClassDelete(id: ID!): TaxClassDelete!
  taxCountryConfigurationUpdate(countryCode: CountryCode!, input: TaxCountryConfigurationUpdateInput!): TaxCountryConfigurationUpdate!
  taxCountryConfigurationDelete(countryCode: CountryCode!): TaxCountryConfigurationDelete!
}

taxConfigurationUpdate
type TaxConfigurationUpdate {
  errors: [TaxConfigurationUpdateError!]!
  taxConfiguration: TaxConfiguration
}

type TaxConfigurationUpdateError {
  field: String
  message: String
  code: TaxConfigurationUpdateErrorCode!
}

enum TaxConfigurationUpdateErrorCode {
  GRAPHQL_ERROR
  DUPLICATED_INPUT_ITEM
}

input TaxConfigurationPerCountryInput {
  countryCode: CountryCode!
  chargeTaxes: Boolean!
  displayGrossPrices: Boolean!
}

input TaxConfigurationUpdateInput {
  chargeTaxes: Boolean
  displayGrossPrices: Boolean
  pricesEnteredWithTax: Boolean
  updateCountriesConfiguration: [TaxConfigurationPerCountryInput!]
  removeCountriesConfiguration: [CountryCode!]  # using countryCode as identifier
}

taxClassCreate
input CountryRateInput {
  countryCode: CountryCode!
  rate: Float!
}

input TaxClassCreateInput {
  name: String!
  updateCountryRates: [CountryRateInput!]
}

type TaxClassCreate {
  errors: [TaxClassCreateError!]!
  taxClass: TaxClass
}

type TaxClassCreateError {
  field: String
  message: String
  code: TaxClassCreateErrorCode!
}

enum TaxClassCreateErrorCode {
  GRAPHQL_ERROR
  DUPLICATED_INPUT_ITEM
}

taxClassUpdate
input TaxClassUpdateInput {
  name: String
  updateCountryRates: [CountryRateInput!]
  removeCountryRates: [CountryCode!]  # using countryCode as identifier
}

type TaxClassUpdate {
  errors: [TaxClassUpdateError!]!
  taxClass: TaxClass
}

type TaxClassUpdateError {
  field: String
  message: String
  code: TaxClassUpdateErrorCode!
}

enum TaxClassUpdateErrorCode {
  GRAPHQL_ERROR
}

taxClassDelete
type TaxClassDelete {
  errors: [TaxClassDeleteError!]!
  taxClass: TaxClass
}

type TaxClassDeleteError {
  field: String
  message: String
  code: TaxClassDeleteErrorCode!
}

enum TaxClassDeleteErrorCode {
  CANNOT_REMOVE_DEFAULT_CLASS
  GRAPHQL_ERROR
}

taxCountryConfigurationUpdate
input TaxClassRateInput {
  taxClassId: ID!
  rate: Float  # accepts null; when null is provided remove this rate for this class/country
}

input TaxCountryConfigurationUpdateInput {
  countryCode: CountryCode!
  updateTaxClassRates: [TaxClassRateInput!]
}

type TaxCountryConfigurationUpdate {
  taxCountryConfiguration: TaxCountryConfiguration
  errors: [TaxCountryUpdateConfigurationError!]!
}

type TaxCountryUpdateConfigurationError {
  field: String
  message: String
  code: TaxCountryConfigurationUpdateErrorCode!
}

enum TaxCountryConfigurationUpdateErrorCode {
  GRAPHQL_ERROR
}

taxCountryConfigurationDelete
type TaxCountryConfigurationDelete {
  taxCountryConfiguration: TaxCountryConfiguration
  errors: [TaxCountryDeleteConfigurationError!]!
}

type TaxCountryDeleteConfigurationError {
  field: String
  message: String
  code: TaxCountryDeleteConfigurationErrorCode!
}

enum TaxCountryDeleteConfigurationErrorCode{
  GRAPHQL_ERROR
}

Tax exemption API (will be done as separate PR)
API to mark a particular checkout/order as tax-exempt (turn of tax collection). Privileged only for apps with proper permissions.
Impact

[x] New migrations
[x] New/Updated API fields or mutations
[x] Deprecated API fields or mutations
[ ] Removed API types, fields, or mutations
[x] Documentation needs to be updated

Pull Request Checklist

[ ] Privileged queries and mutations are guarded by proper permission checks
[ ] Database queries are optimized and the number of queries is constant
[ ] Database migration files are up to date
[ ] The changes are tested
[ ] GraphQL schema and type definitions are up to date
[ ] Changes are mentioned in the changelog

@maarcingebala Simple taxes API feature will be add in the 3.6 version?

Hey @Qasem-h, we're aiming to release it in Saleor 3.7 (you can check it by the currently assigned milestone).

Nice 🚀
After this is merged I think that there won't be no need for the plugin I created here https://github.com/carlosa54/saleor-flat-tax-plugin

@carlosa54 Nice work with the plugin! 🚀


Move server db to its own package

Implemented in the two commits: https://github.com/djavorszky/ddn/compare/3dce100c2aba7afd07207975739b3837287edd16...c48c881dc475e40d6b29b60ee7dee00f22b651eb


Opener on iOS 9.3.3

Newest update 3.2 has been causing my iPhone on iOS 9.3.3 to go into safe mode.

We're aware of this and will fix it in the next update.

in the meantime, is there a way to go back to version 3.1? Cydia isn't giving me the option to downgrade

@woojoo666, please try 3.2.1 from https://cydia.hbang.ws/. Does that work for you? 3.1.3 is also available on that repo if you’re still having issues.

3.2.2 works for me for iOS 9.2.1. please make it into common repo

@kirb my bad I just saw your comment, I don't have my iphone anymore so I can't test it, sorry


docker-compose fails for devcontainer when root dir is not empty

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

VS Code Version:
Version: 1.76.1
Commit: 5e805b79fcb6ba4c2d23712967df89a089da575b
Date: 2023-03-08T16:31:31.010Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: <IP_ADDRESS>-electron.0
OS: Linux x64 5.19.0-35-generic snap
Sandboxed: Yes

OS Version:
Linux  5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Steps to Reproduce:

create a devcontainer configuration with docker-compose.yml, for example, the "Python 3 & PostgreSQL" standard config using the "dev containers: Add devcontainer config" menu.
put more than one files in the root directory where the .devcontainer directory is created.  for example. touch 1st.file and then touch 2nd.file
try to "build  and reopen in container". . .  it will fail, and in the containers log, you will see:

[2023-03-12T22:18:04.053Z] Start: Run: docker-compose -f /home/alan/acerta/python-example/backend/.devcontainer/docker-compose.yml --profile * config
[2023-03-12T22:18:04.094Z] Stop (41 ms): Run: docker-compose -f /home/alan/acerta/python-example/backend/.devcontainer/docker-compose.yml --profile * config
[2023-03-12T22:18:04.094Z]
Usage:  docker compose [OPTIONS] COMMAND

Docker Compose

Options:
      --ansi string                Control when to print ANSI control
                                   characters ("never"|"always"|"auto")
                                   (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --env-file string            Specify an alternate environment file.
  -f, --file stringArray           Compose configuration files
      --parallel int               Control max parallelism, -1 for
                                   unlimited (default -1)
      --profile stringArray        Specify a profile to enable
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the, first
                                   specified, Compose file)
  -p, --project-name string        Project name

Commands:
  build       Build or rebuild services
  convert     Converts the compose file to platform's canonical format
  cp          Copy files/folders between a service container and the local filesystem
  create      Creates containers for a service.
  down        Stop and remove containers, networks
  events      Receive real time events from containers.
  exec        Execute a command in a running container.
  images      List images used by the created containers
  kill        Force stop service containers.
  logs        View output from containers
  ls          List running compose projects
  pause       Pause services
  port        Print the public port for a port binding.
  ps          List containers
  pull        Pull service images
  push        Push service images
  restart     Restart service containers
  rm          Removes stopped service containers
  run         Run a one-off command on a service.
  start       Start services
  stop        Stop services
  top         Display the running processes
  unpause     Unpause services
  up          Create and start containers
  version     Show the Docker Compose version information

Run 'docker compose COMMAND --help' for more information on a command.
[2023-03-12T22:18:04.094Z] unknown docker command: "compose 1st.file"

[2023-03-12T22:18:04.094Z] Exit code 16
[2023-03-12T22:18:04.095Z] Error: Command failed: docker-compose -f /home/alan/acerta/python-example/backend/.devcontainer/docker-compose.yml --profile * config
[2023-03-12T22:18:04.095Z]     at xc (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:1930:867)
[2023-03-12T22:18:04.096Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-03-12T22:18:04.096Z]     at async sie (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:1896:1370)
[2023-03-12T22:18:04.096Z]     at async iie (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:1878:2396)
[2023-03-12T22:18:04.096Z]     at async xie (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:1945:2798)
[2023-03-12T22:18:04.096Z]     at async Wf (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:1945:3750)
[2023-03-12T22:18:04.096Z]     at async noe (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:2069:17325)
[2023-03-12T22:18:04.096Z]     at async roe (/home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js:2069:17066)
[2023-03-12T22:18:04.099Z] Stop (322 ms): Run: /snap/code/121/usr/share/code/code --ms-enable-electron-run-as-node /home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/alan/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-2a597851-044c-4e2e-86cc-6df79ded39ff1678659483083 --workspace-folder /home/alan/acerta/python-example/backend --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/alan/acerta/python-example/backend --id-label devcontainer.config_file=/home/alan/acerta/python-example/backend/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/alan/acerta/python-example/backend/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-03-12T22:18:04.099Z] Exit code 1
[2023-03-12T22:18:04.101Z] Command failed: /snap/code/121/usr/share/code/code --ms-enable-electron-run-as-node /home/alan/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/alan/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-2a597851-044c-4e2e-86cc-6df79ded39ff1678659483083 --workspace-folder /home/alan/acerta/python-example/backend --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/alan/acerta/python-example/backend --id-label devcontainer.config_file=/home/alan/acerta/python-example/backend/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/alan/acerta/python-example/backend/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-03-12T22:18:04.101Z] Exit code 1

troubleshooting steps, now, delete but 1 file, then try "dev containers: rebuild and reopen in container" again, it will now work.

It seems that the command docker-compose -f /home/alan/acerta/python-example/backend/.devcontainer/docker-compose.yml --profile * config is failing, because the "" was not properly escaped, and is  processed by the shells' pathname expansion. When there are multiple files in the root directory, the commnad was expanded to list all those file names to replace the "".   (So even when you only have 1 file it is still not handled correctly just it won't cause a syntax error to docker-compose.

I'm having this exact issue. It seems to be because of the use of --profile *. If you manually run the command from the log docker expands the * to be a list of the files in the root directory of the project and throws an error saying things like "command not found README.md"

The extension runs the command without shell. Is docker-compose Docker's Compose executable or a shell script that might inadvertently trigger the glob expansion?

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!

The extension runs the command without shell. Is docker-compose Docker's Compose executable or a shell script that might inadvertently trigger the glob expansion?

I'm not sure what do you mean by "extension", this is the very first step of opening the repo in devcontainer, not loading any extensions yet.
The problem is when VScode tries to invoke docker-compose, it does the glob expansion.  There is nothing the user can insert as a shell because how docker-compose is called was not configurable to the users.
That being said, VSCode is launched from Wayland.


Release on opam as ppx_graphql

As discussed on Discord, @Andreas might be willing to "donate" the name on opam. If he likes the project and decides to do so, I believe it'd be great to release it there. Depending on resolutions is less than ideal.

Thanks for suggesting this, @wokalski. I'd be happy to see this project on OPAM under the ppx_graphql name 😄

@wokalski @andreas But why? The project is called graphql_ppx. Even if it's not conventional, there's no reason to want to use a different name on opam. Unless you wish to rename it everywhere.

I'd personally like consistent naming everywhere @Zimmi48. I think @jfrolich or other contributors will resolve this issue as they see fitting. I just want it published to opam and I want it to be obvious for opam users what's the go to ppx.

@wokalski graphql_ppx and ppx_graphql were previously published on opam, so choosing either name wouldn't solve the issue of clearly indicating to opam users what is the way to go. Given that unpublishing a package would be bad practice, I propose to simply include DEPRECATED in the synopsis of ppx_graphql as soon as graphql_ppx has been updated. My intern @jtcoolen will take care of opening the PR on opam-repository updating graphql_ppx from version 0.0.4 to version 0.7.1.

Done: https://opam.ocaml.org/packages/graphql_ppx/
@andreas It's probably best if you are the one opening the PR to add DEPRECATED to the description of ppx_graphql (but I can do it on your behalf if you prefer). It would be great also if you could redirect users to graphql_ppx from the README and archive the repository. Otherwise, you'll keep receiving PRs like https://github.com/andreas/ppx_graphql/pull/8 from people who are missing out on the recommended alternative.

I am for using @reasonml-community/graphql-ppx on npm
and ppx_graphql on opam, so we use the naming conventions for both platforms.

graphql_ppx is not the first package to have a trailing _ppx instead of a leading ppx_ on opam. And by using a different name on opam than in the repository, you'd be breaking a stronger convention IMHO. In any case, the package is already published on opam, so I wonder what you're proposing @jfrolich? To publish a single package under two names?

graphql_ppx is not the first package to have a trailing _ppx instead of a leading ppx_ on opam. And by using a different name on opam than in the repository, you'd be breaking a stronger convention IMHO. In any case, the package is already published on opam, so I wonder what are you proposing @jfrolich? To publish a single package under two names?

1.0 will be published under @reasonml-community/graphql-ppx instead of graphql_ppx, so it would be good to change the OPAM published version for a _ to a dash to make it all consistent when 1.0 lands.

I see, thanks for clarifying! Is the plan to also rename the repo? In any case, the package name in dune-project and in the name of the opam file should probably be fixed in the 1.0 branch if the package is to be published as graphql-ppx.

I see, thanks for clarifying! Is the plan to also rename the repo? In any case, the package name in dune-project and in the name of the opam file should probably be fixed in the 1.0 branch if the package is to be published as graphql-ppx.

Yes. Will be part of the release TODO.


refactor: node account

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Closes:
Type of change

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

[ ] Tested CCTX in localnet
[ ] Tested in development environment
[ ] Go unit tests
[ ] Go integration tests
[ ] Tested via GitHub Actions

Checklist:

[ ] I have added unit tests that prove my fix feature works

Closing this PR , in favor of
https://github.com/zeta-chain/node/pull/829
Which has changes and migration functions bundled together


RFC: E2E Testing

💥 Proposal
As the codebase grows, it would be beneficial to add more/different kinds of testing strategies. I think expanding E2E testing with an automation tool like Selenium could improve coverage.
NextJS implemented this style of tesing on top of all of their other unit tests and it works very well.
I can start a draft if this gets approved because I have an idea on how it could be implemented.
Have you read the Contributing Guidelines on issues?
Yes

Hi,
We already have e2e tests that basically generate a fresh new D2 website and try to yarn build it.
https://github.com/facebook/docusaurus/blob/master/.github/workflows/e2e-test.yml
But that could be a nice addition to have additional end2end tests to verify the site's behavior.
Do you have in mind what kind of behavior you want to check with these tests?
I'd rather use Cypress than Selenium.

it could integrate with our Netlify deploy previews: https://www.cypress.io/blog/2020/03/30/run-cypress-tests-on-netlify-using-a-single-line/

I was thinking of testing some of the default pages such as home, blog, showcase, and community just to verify that everything renders properly. We can make this expandable to include things such as buttons and links.

I think if we create a component library for the classic theme that would help test individual components in a storybook. (https://github.com/facebook/docusaurus/issues/3065).
I don't think it's needed to "verify that everything renders properly". Visual tests should rather be done in isolation, like in Storybook/Chromatic, and the nature of Docusaurus being a static site means that if things don't render properly, the site will simply not build.
But that could be interesting to have cypress tests running on top of the classic template, to check some behavior is ok, like maybe the dark mode switch, basic navigation, search integration...


Attempt to edit exercise hangs the program

(The picture below was taken after the "cannot find moving piece" exception was allowed to be ignored from the debugger. Otherwise the program would have been frozen.)

No repro.


Virtual row rendering on / off flag added

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
There is no option to turn off virtual rendering of rows.
Fixes - #1126
What is the new behavior?
A new boolean parameter added virtualRow. The default value is true. Pass it false to turn off virtual row rendering.
Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:

Lets rename virtualRow to virtualization.

Good job .


xWebSite: Fix for the issue #332

@johlju , here you go - one line fix!
Fixes #332

This change is

Thanks for this! Appreciate you resolving this! :smile:

Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.

a discussion (no related file):
Could you please add a regression unit test that tests multiple certificates so the result of this is correct and we don't get this problem down the road?

a discussion (no related file):
Please add a new entry to the change log for this change.

Comments from Reviewable

Labeling this PR as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on the PR is taken up again.

Seems like a tiny change to get that fix in, so I removed the abandoned label and will try to get back to it in the near future.
@konste if you have time to solve the points made in the review that'd be much appreciated (especially the entry in release notes).

This issue is affecting our organization as well, and we had to disable DSC configuration of our web bindings for the time being. Just to confirm, all that's needed is a test and a change log entry before it can be merged, right?

Right.

@mcbobke yes, just a regression test (that would fail if this change is not applied), and a change log entry explaining what the change resolves.
Tag me for review as soon as that is resolved in this PR or another PR is sent in that closes this one, whatever is simplest. :smile:

Sounds good! I'll be working on this.

I am sorry, I left this area a while ago. @mcbobke please let me know if you need anything from me to push the fix through.

I appreciate the offer @konste ! I just created #437 to move forward from here.


Spec: we need to solve non-determinism for rowids

Today we have a problem with letting users manipulate the rowid value of a row, which can result in non-determinism because (quoting SQLite spec):

If the largest ROWID is equal to the largest possible integer<PHONE_NUMBER>854775807) then the database engine starts picking positive candidate ROWIDs at random until it finds one that is not previously used.

We've been chatting with @brunocalza about this problem, and it's quite nuanced.
Some notes about this problem:

If the user defines a INTEGER PRIMARY KEY (with or without AUTOINCREMENT), it becomes an alias for rowid, which is the crux of the problem.
If we allow the user to assign<PHONE_NUMBER>854775807 to rowid, _rowid_, oid then the next insert would be non-deterministic.
The above bullet also applies to a column name the user-defined as INTEGER PRIMARY KEY (with or without AUTOINCREMENT).
PRIMARY KEYs that aren't INTEGER won't create an alias, which can help narrow down the spec change.

Tentative/fuzzy idea skeleton:

If a user wants to define an INTEGER PRIMARY KEY (with or without AUTOINCREMENT), it should have a fixed name defined by the spec (e.g: say __id). The idea is to allow the parser to detect invalid queries (see point below)
The spec should only allow a direct assignment or updates to column names rowid, _rowid_, oid or __id with constant values lower than some number X (where X <<<PHONE_NUMBER>854775807).
User defined PRIMARY KEYs which aren't INTEGER looks like they are safe to have arbitrary assignments.

The above are some quick notes, we need to jump into a convo about this to dive deeper.
We have to remember to discuss what this means for existing history.

Here's an example that illustrates the problem:
sqlite> create table a (id INTEGER PRIMARY KEY, a TEXT);
sqlite> insert into a  VALUES<PHONE_NUMBER>854775807, 'Hello');
sqlite> select rowid, id, a from a;
9223372036854775807|9223372036854775807|Hello
sqlite> insert into a (a)  VALUES ('Hello 2');
sqlite> select rowid, id, a from a;
3587427864672888140|3587427864672888140|Hello 2
9223372036854775807|9223372036854775807|Hello

If you run that again in a new database, you'll get a different values of id and rowid for Hello 2 row.

After a core team discussion, we are proposing the following changes:

Block all assignment to rowid and all aliases (e.g.,  __rowid__, oid, etc) in the parser
Force all PRIMARY KEY INTEGER directives to implement PRIMARY KEY INTEGER [AUTOINCREMENT](https://www.sqlite.org/autoinc.html), but do not directly support the AUTOINCREMENT keyword
Allow INT and TEXT (and other) PRIMARY KEY values to operate without restriction
Update the spec docs to include the above changes
Test the above implicit autoincrement behavior to ensure it doesn't break any existing tables
Document that assignment to an auto incrementing primary key could result in locking a table from further inserts if the max value of the primary key reaches the largest possible integer<PHONE_NUMBER>854775807) we support

cc @sanderpick @jsign @brunocalza @dtbuchholz @asutula @joewagner @awmuncy

Note that thanks to initial sleuthing by @jsign, we know that there are no detected statements that habe references to:

rowid
oid
_rowid_

And that there are a total of 669 statements that reference an INTEGER PRIMARY KEY (almost entirely CREATE TABLE statements), and these correspond to approximately 560 tables. Depending on how these tables use the PRIMARY KEY, the above proposed changes may have zero impact on the state of the Tableland network. That is best case scenario, and we'll have to test things out to be sure.

Just found this:

With one exception noted below, if a rowid table has a primary key that consists of a single column and the declared type of that column is "INTEGER" in any mixture of upper and lower case, then the column becomes an alias for the rowid. Such a column is usually referred to as an "integer primary key". A PRIMARY KEY column only becomes an integer primary key if the declared type name is exactly "INTEGER". Other integer type names like "INT" or "BIGINT" or "SHORT INTEGER" or "UNSIGNED INTEGER" causes the primary key column to behave as an ordinary table column with integer affinity and a unique index, not as an alias for the rowid.
The exception mentioned above is that if the declaration of a column with declared type "INTEGER" includes an "PRIMARY KEY DESC" clause, it does not become an alias for the rowid and is not classified as an integer primary key. This quirk is not by design. It is due to a bug in early versions of SQLite. But fixing the bug could result in backwards incompatibilities.

In short: INTEGER PRIMARY KEY DESC does not become an alias.
So, for completeness,  we only force AUTOINCREMENT on INTEGER PRIMARY KEY and INTEGER PRIMARY KEY ASC.

There's also a slightly harder case to consider:
CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x DESC));
In that case, the primary is defined at the end as a table constraint and not as a column constraint. I think the solution to that is to transform that statement to
CREATE TABLE t(x INTEGER PRIMARY KEY AUTOINCREMENT, y, z );
behind the scenes. Because I can't add an AUTOINCREMENT to the table constraint. It would be syntactically incorrect.
cc @jsign @carsonfarmer
or we block that kind of table constraint. maybe cleaner?

Maybe you meant  ... PRIMARY KEY(x) or ... PRIMARY KEY(x ASC)?
Transforming ... PRIMARY KEY(x DESC) to x INTEGER PRIMARY KEY AUTOINCREMENT) seems to be changing the DESC to ASC?

Maybe you meant ... PRIMARY KEY(x) or ... PRIMARY KEY(x ASC)?

Yeah. I meant CREATE TABLE t(x INTEGER PRIMARY KEY DESC AUTOINCREMENT, y, z );

Maybe you meant ... PRIMARY KEY(x) or ... PRIMARY KEY(x ASC)?

Yeah. I meant CREATE TABLE t(x INTEGER PRIMARY KEY DESC AUTOINCREMENT, y, z );

But in the DESC case we don't need to force AUTOINCREMENT, right? (your previous comment).

But in the DESC case we don't need to force AUTOINCREMENT, right? (your previous comment).

In that case, we need actually. From docs:

This means that the following three table declarations all cause the column "x" to be an alias for the rowid (an integer primary key):
CREATE TABLE t(x INTEGER PRIMARY KEY ASC, y, z);
CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x ASC));
CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x DESC));
But the following declaration does not result in "x" being an alias for the rowid:
CREATE TABLE t(x INTEGER PRIMARY KEY DESC, y, z);

CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x DESC));

Wow, OK that's incredibly weird:

CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x DESC)); is an alias.
CREATE TABLE t(x INTEGER PRIMARY KEY DESC, y, z); isn't an alias.
In the ASC case, in both styles is an alias.

Cool, now makes sense!

Cripes, ok that is super weird. Right, so the proposed solution here is that we transform the table constraint version to a more canonical direct constraint on the primary key, or we simply block primary key table constraints in the first place, and require that they are specified "inline" so to speak?

I think we can't really block the table constraint version, because IIRC this is the only way to specify a multi-column primary key? Right? So actually, this might be an issue in general!?

Those are the two options: transforming the table constraint version to a more canonical direct constraint on the primary key or blocking a table constraint primary key that references a single column INTEGER. Both should be similar to implement. Not sure which one is best for users.

The first option (transform constraints) sounds a bit more pleasant for users. With the second option (blocking table constraint), we'd need to return an error that might be hard to understand: "error: table primary key constraints that ref a single column of type INTEGER are not supported", or similar. With the first option, it "just works".


=Marshmellow CRASH. IllegalStateException: Underflow in restore - more restores than saves

Hi, I'm getting the following crash when I try to fill the CropImageView after I get an image from the gallery:
java.lang.IllegalStateException: Underflow in restore - more restores than saves
           at android.graphics.Canvas.native_restore(Native Method)
           at android.graphics.Canvas.restore(Canvas.java:571)
           at com.theartofdev.edmodo.cropper.cropwindow.CropOverlayView.drawBackground(CropOverlayView.java:555)
           at com.theartofdev.edmodo.cropper.cropwindow.CropOverlayView.onDraw(CropOverlayView.java:312)

Everything was working fine until I tried it on Samsung S6 (Android version 6.0.1).
Here is the code to insert the image:
@Override
    protected void onActivityResult(int  requestCode, int resultCode, Intent data) {
        if (resultCode == Activity.RESULT_OK) {
            imageUri =  data.getData();
            civ_image.setImageUri(imageUri);
        }else{
            if(imageUri == null){
                finish();
            }
        }
    }

that is very strange.. are you using the latest version?

You are right. I was using version 1.0.1. I updated to the latest one (2.2.3) and now it works perfect.
Sorry for the inconvenient.
CLOSED.

No problem, many new features since 1.*, check the change log.


AcmAutoRefreshSelect calls refetch when the selection is Disable refresh

If I go from an active refresh status to Disable refresh, before disabling the refresh, the refetch function is called one last time
This is an issue since most of the time the Disable refresh is selected when something is wrong with the UI or when you want to preserve the current state.
Steps :

select refresh every 1min , or any other interval
now select Disable refresh
right away a refetch is called; then the refresh action is disabled
Refetch should not be called at all

@RobDolares can we have this looked into for 2.3 ?

I think this was fixed somewhere along the way, and I also fixed the case where if you hide the window and return to it, it was refreshing when disabled. (See https://github.com/open-cluster-management/ui-components/commit/304abc1ce7f942ce045a787ac5da65701d233fa2)
Can you please check and close @birsanv? Thanks.

I can still reproduce the issue with the final 2.3 build 2.3.0-DOWNSTREAM-2021-06-23-22-07-39
If I select Disable refresh, refresh is called one more time
If I switch between tabs I can see the refresh is called again

Problem was fixed in ui-components v0.166.0
application-ui only picked up a version with this fix on June 28

closing since this was fixed with the latest code although the fix is not available with the final ACM 2.3 image


[EAGLE-597] Add API to filter publishment and single policy metadata by policyId

Alert engine publishments API only support to provide all publishments and let client-side to filter according requirements, which is NOT an scalable implementation.
As a quick solution to fix it in some way, we should provide a API to filter publishments by policy ID, so in this patch it mainly added two APIs:

GET /metadata/policies/{policyId}
GET /metadata/policies/{policyId}/publishments

It's a simple patch adding a few features, and passed CI, so will merge.


Can't find a way to set up options...

Hello, I really can't find how to set up the options...

Am I doing something wrong? Usually the Options button should be rendered on the left side of Uninstall button...
Should I set them in some configuration file?

Hey! Have you tried restarting Atom? In some cases I had same problem with other plugins and this helped me.

oh, boy, that was it. Thank you, @armin-pfaeffle !


Media Formatter

How do you implement a custom MediaFormatter in MVC 6?
Greetings Damien

MediaTypeFormatter has been split into IInputFormatter and IOutputFormatter in MVC6. You can take a look at the built-in formatters in MVC to get you started. For example:
https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/Formatters/StringOutputFormatter.cs


Error: Failed to initialize Guardian

During CI pipeline:
##[error]Error: Unable to locate executable file: 'npm'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

Fixed in #353


Typings install fail in npm postinstall script

Prerequisites

[x] Did you check the FAQ?
[x] Did you search open and closed issues to see if your issue has already been reported?

Description
Typings can't be installed as an npm postinstall script. The install always fail.
Steps to Reproduce

Run git clone git@github.com:budacode-playground/setgame.git
Run npm install
Notice that the install fails
Run typings install
See that the typings install works when called directly

Expected behavior:
Typings can be installed in a npm postinstall script so users can start to use your library with an only npm install command.
Actual behavior:
typings install fails with the following error message:
> typings i

typings ERR! message Unknown dependency: registry:dt/es6-collections#0.5.1+20160316155526

typings ERR! cwd /Users/attila/budacode/setgame
typings ERR! system Darwin 15.4.0
typings ERR! command "/usr/local/Cellar/node/6.0.0/bin/node" "/Users/attila/budacode/setgame/node_modules/typings/dist/bin/typings-install.js"
typings ERR! node -v v6.0.0
typings ERR! typings -v 0.6.10

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>

npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node/6.0.0/bin/node" "/usr/local/bin/npm" "i"
npm ERR! node v6.0.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR<EMAIL_ADDRESS>postinstall: `typings i`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>postinstall script 'typings i'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-mdl-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings i
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ng2-mdl-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ng2-mdl-seed
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/attila/budacode/setgame/npm-debug.log

Versions
Typings: 0.8.1
Node: v6.0.0
NPM: 3.8.6

@NoNameProvided It doesn't work because the local version is older (before registry: existed). Look at the version in the error message (typings -v 0.6.10). If you update it, it will work.

Ahh, thanks for the catch!


Make memory request configurable again

What this PR does / why we need it:
This is a modified version of #2203 that:

Improves the test of the default machine type by using a new matcher SatisfyAnyRegexp.
Removes functions with similar logic to that of testutils#NewFakeClusterConfig
Moves feature gates to ClusterConfig (all the changes that were part of #2211)

Special notes for your reviewer:
All differences, compared to #2203 , are within the commits that start at remove mock_config.go#MakeFakeClusterConfig in favor of NewFakeClusterConfig (including)
Release note:

NONE

/cc @davidvossel @rmohr @cynepco3hahue

@davidvossel hi, can you please follow up on this?

No problem :) Thank you David!


Package 3.12.0 wrong arm64 architecture

Looks like latest 3.12.0 release has wrong architecture or file naming:
wget https://github.com/cdr/code-server/releases/download/v3.12.0/code-server_3.12.0_arm64.deb
sudo dpkg -i code-server_3.12.0_arm64.deb
dpkg: error processing archive code-server_3.12.0_arm64.deb (--install):
 package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
 code-server_3.12.0_arm64.deb

Package 3.11.1 works well:
wget https://github.com/cdr/code-server/releases/download/v3.11.1/code-server_3.11.1_arm64.deb
sudo dpkg -i code-server_3.11.1_arm64.deb
Selecting previously unselected package code-server.
(Reading database ... 140538 files and directories currently installed.)
Preparing to unpack code-server_3.11.1_arm64.deb ...
Unpacking code-server (3.11.1) ...
Setting up code-server (3.11.1) ...

Ubuntu 21.04 arm64 as guest at UTM Apple M1 host

Having the same issue on oracle ARM instance.

$ sudo dpkg -i code-server_3.12.0_arm64.deb
dpkg: error processing archive code-server_3.12.0_arm64.deb (--install):
 package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
 code-server_3.12.0_arm64.deb

Thanks for reporting this! Yeah, I think we missed a step when we redid our packaging. We're investigating this!

We just uploaded new assets to the 3.12.0 release here. Can you try again and let us know if it works?

Thank you, it works!
sudo dpkg -i code-server_3.12.0_arm64.deb
(Reading database ... 140521 files and directories currently installed.)
Preparing to unpack code-server_3.12.0_arm64.deb ...
Unpacking code-server (3.12.0) over (3.11.1) ...
Setting up code-server (3.12.0) ...


Problem with Unmount SD option

It seems "Unmount SD" option doesn't work while using the "Built-in Installer" (in the normal app & both Magisk Module version apps). The progress reaches "Processing system partition" in a second, and stays there forever. It never ends.
But if I try again After Manually removing the SD Card, then the process finishes successfully after like 10 seconds.
There's no such problem if Not Using "Built-in Installer"...

Fingerprint & Face Unlock doesn't work if the GSIs are flashed via DSU Sideloader.
But they work if flashed via Fastboot.

Device : Realme 9SE / Q3s (RMX3461)
Android version : 13 (these same problems are present in older android versions too)

Exactly same problem is there on the latest 2.03 (8) version too.

First problem needs investigation, but seems to be confirmed, i've tested in two devices and bug occurs, ill look into this once i get some time.
Now, the second one i cannot reproduce, GSIs installed via DSU should work the same as the ones flashed with fastboot, are you doing something more than when installing using fastboot? what GSI you're trying to boot? so i can test it by myself.

First problem needs investigation, but seems to be confirmed, i've tested in two devices and bug occurs, ill look into this once i get some time. Now, the second one i cannot reproduce, GSIs installed via DSU should work the same as the ones flashed with fastboot, are you doing something more than when installing using fastboot? what GSI you're trying to boot? so i can test it by myself.

The 2nd problem is there in all the GSIs I flash over Stock ROM. But they work normally if flashed over custom ROM. Could it be a limitation of the stock kernel?
I'm attaching a screenshot of log which seemed relevant.

If you're fine using a Custom ROM for installing GSIs, you should be able to use DSU Sideloader with Custom ROM

If you're fine using a Custom ROM for installing GSIs, you should be able to use DSU Sideloader with Custom ROM

Actually DSU Sideloader on custom ROM was tested by other users from my device community. I personally prefer using it over stock ROM.