duplicate refresh requests when using controller on multiple views

The information in this comment are outdated.
Please see the comments further down for a comprehensive issue description.

I have run into the curious issue that any PagedView that receives a refresh call
but isnt the top most route will call the requestPage callback twice in a row.
I have laced my code with extensive debug logs because it was impossible to breakpoint it.
heres what the log looks like:
#5c79c is the very first (root) route.
#6d0c2 is the middle route.
#8a43b is the top (current) route.
Performing hot reload...
Syncing files to device Windows...
Reloaded 145 of 1439 libraries in 2’413ms.
flutter: [#5c79c] instantiated!
flutter: [#5c79c] started waiting for a request page!
flutter: [#5c79c] loading page 1
flutter: [#5c79c] appending a new page of length 70
flutter: [#5c79c] providing a next page key: 2
flutter: [#5c79c] done requesting and adding page, releasing lock!
flutter: [#6d0c2] instantiated!
flutter: [#6d0c2] started waiting for a request page!
flutter: [#6d0c2] loading page 1
flutter: [#6d0c2] appending a new page of length 73
flutter: [#6d0c2] providing a next page key: 2
flutter: [#6d0c2] done requesting and adding page, releasing lock!
flutter: [#8a43b] instantiated!
flutter: [#8a43b] started waiting for a request page!
flutter: [#8a43b] loading page 1
flutter: [#8a43b] appending a new page of length 70
flutter: [#8a43b] providing a next page key: 2
flutter: [#8a43b] done requesting and adding page, releasing lock!
flutter: [#5c79c] triggered refresh by ValueNotifier<String>#515e8
flutter: [#5c79c] allowed a refresh!
flutter: [#6d0c2] triggered refresh by ValueNotifier<String>#515e8
flutter: [#6d0c2] allowed a refresh!
flutter: [#8a43b] triggered refresh by ValueNotifier<String>#515e8
flutter: [#8a43b] allowed a refresh!
flutter: [#5c79c] resetting posts now!
flutter: [#5c79c] allowed a refresh!
flutter: [#6d0c2] resetting posts now!
flutter: [#6d0c2] allowed a refresh!
flutter: [#8a43b] resetting posts now!
flutter: [#8a43b] allowed a refresh!
flutter: [#5c79c] calling super.refresh!
flutter: [#5c79c] started waiting for a request page!
flutter: [#5c79c] started waiting for a request page!
flutter: [#6d0c2] calling super.refresh!
flutter: [#6d0c2] started waiting for a request page!
flutter: [#6d0c2] started waiting for a request page!
flutter: [#8a43b] calling super.refresh!
flutter: [#8a43b] started waiting for a request page!
flutter: [#5c79c] loading page 1
flutter: [#6d0c2] loading page 1
flutter: [#8a43b] loading page 1
flutter: [#6d0c2] appending a new page of length 7
flutter: [#6d0c2] providing a next page key: 2
flutter: [#6d0c2] done requesting and adding page, releasing lock!
flutter: [#6d0c2] loading page 1
flutter: [#6d0c2] started waiting for a request page!
flutter: [#5c79c] appending a new page of length 79
flutter: [#5c79c] providing a next page key: 2
flutter: [#5c79c] done requesting and adding page, releasing lock!
flutter: [#5c79c] loading page 1
flutter: [#8a43b] appending a new page of length 80
flutter: [#8a43b] providing a next page key: 2
flutter: [#8a43b] done requesting and adding page, releasing lock!
flutter: [#6d0c2] appending a new page of length 7
flutter: [#6d0c2] providing a next page key: 2
flutter: [#6d0c2] done requesting and adding page, releasing lock!
flutter: [#6d0c2] loading page 2
flutter: [#6d0c2] started waiting for a request page!
flutter: [#6d0c2] done requesting and adding page, releasing lock!
flutter: [#6d0c2] loading page 2
flutter: [#5c79c] appending a new page of length 79
flutter: [#5c79c] providing a next page key: 2
flutter: [#5c79c] done requesting and adding page, releasing lock!
flutter: [#6d0c2] done requesting and adding page, releasing lock!
flutter: [#8a43b] banished to the shadow realm!
flutter: [#6d0c2] banished to the shadow realm!

in the log you can see that both routes that are not at the top, #5c79c and #6d0c2 get two requests for loading a new page.
said two requests are issued exactly at the same time.
In my code I use mutex locks to prevent multiple requests from ever running at the same time,
so those 2 requests are ran after each other, but theyre still ran with the same page key.
I have also printed the stack trace logs and made sure that it is not my code that is triggering multiple refresh requests.
In the log above, you can see how my linked valuenotifier is only ever triggering a single request.
You can also see how the top most route, #8a43b only triggers a single refresh request.
this issue also occurs on android and it happens exactly the same everytime.
I have also tested this with only a single route at the bottom, said route will still receive two refresh requests.
I am using version 4.0.0 on 268945f (because I would like to use the staggered grid and page view paged variants).
My code for using the PagingController is rather complicated but I doubt it is the cause of this issue,
regardless, it could be found here:

general implementation
specific implementation

okay, I have understood the nature of this issue better with some investigation.
What happens is that when multiple paged views are hooked up to the same paged controller, and a refresh is called on that controller, all of the pageviews will request another refresh extra.
This only seems to happen when theyre not visible (aka not the current route).
Anything further is unclear to me.
The reason this happened in my code is because I replaced my normal page view with a paged page view.
This would lead to the follog constelation: (single layer)
PagedGridView (controller a)
PagedPageView (controller a)
PagedGridView (controller b)
even though my code will immediately pop the pagedpageview in the case of it changing its contents to not include the item on the current page of the pageview, the pageview still seems to fire off a refresh before being popped, leading to multiple refresh requests with the very same key.
I assume this "issue" would also be present in the previous version of this package, 3.1.0,
it just only happened to me because I used pagedpageviews.
I will remove the pagedpageviews for now, though I am unsure how I could fix this issue on my end, or how it could be fixed in general. I assume, the paged controller would need to somehow dedupe these requests for my setup to work.
I am very sorry, all of this relevant information wasnt in my issue at first.

I think I just understood that this issue is where my usage of the PagingController and the philosophy of the package are clashing.
In my extension of the PagingController, a single item providing callback has to be specified and it is guarded by mutex locks, where as the normal PagingController barely takes control of the callback, as you may add as many listeners as you like and the controller doesnt keep track of whether it is completed or not.
But personally i never understood how adding multiple listeners would work well, as the PagingStatus doesnt seem to factor in whether a request is currently happing or not.
If I read the source code right, it simply doesnt. the loading indicator is always there as long as there is a next page key to be processed.
Though its also unclear to me how having multiple page listeners would work in terms of order. If one of my 2 page listeners on page 3 (assuming I use integers as keys)  takes longer and the user starts requesting page 4 and the first one from page 4 completes before the second on page 3, then the order is messed up.
Basically what I am saying is, I would advocate for removing the ability to add multiple page request listeners and then have that one listener be more controlled so that it can be assured that not multiple requests are ongoing at the same time.
This would definitely be a rather large breaking change, but I feel like this behaviour would be more desirable than the current one. I would also have to write less wrapper class code hehe.

I noticed the same behavior too, while using the Paging Controller to display in two views and manually refreshing the page.
My use case is initial results will be showed in horizontal scroll view (paginated), then an option to show all results in a grid view. Once the user refresh the results in the grid view, the current page get duplicated.
version 3 of this package
infinite_scroll_pagination: ^3.1.0

Flutter version
>flutter --version
Flutter 2.8.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cf44000065 (5 days ago) • 2021-12-08 14:06:50 -0800
Engine • revision 40a99c5951
Tools • Dart 2.15.0

I had the same problem don't know the solution but as a workaround I made a function that detects if the list is refreshed twice by identifying if the list contains duplicate items you can use a set or any other solution will make it also this is the code
bool _listIntersects<T>(     PagingController<int, T> pagingController,     List<T> data,   ) {     if (pagingController.itemList != null) {       bool isIntersect = true;       data.forEach(         (item) {           if ((pagingController.itemList!.contains(item))) isIntersect = false;         },       );       return isIntersect;     }     return false;   }
you can use it before appending either a page or last page to the paging controller

thats not a very nice solution because this will lead to 2 API calls, which means more network traffic.

Block the loading completely if some page is not loaded 100%!  If the page size is small like 3, the page 0 and 1 are loading almost simultaniously on big screens. Original counter messes up and sometimes I see 1 page before page 0. Also there is need to block refresh if we currently loading some big page, like 10 items of huge json`s
//in class declaration
bool _isLoadingStarted = false;
//in init
@OverRide
void initState() {
super.initState();
_pagingController.addPageRequestListener((pageKey) async {
if ((_pagingController.value.status == PagingStatus.loadingFirstPage ||
_pagingController.value.status == PagingStatus.ongoing) &&
_isLoadingStarted) return;
_isLoadingStarted = true;
await _fetchPage(Provider.of(context, listen: false),
pageKey, widget.YourItemId);
});
}
//on refresh
onRefresh: () async {
if ((_pagingController.value.status ==
PagingStatus.loadingFirstPage ||
_pagingController.value.status == PagingStatus.ongoing) &&
_isLoadingStarted) return;
extensions.clear();
_pagingController.refresh();
},

this issue can be traced back to exactly this place in the code:
line 160-172 in paged_layout_builder.dart
        listener: () {
          final status = _pagingController.value.status;

          if (status == PagingStatus.loadingFirstPage) {
            _pagingController.notifyPageRequestListeners(
              _pagingController.firstPageKey,
            );
          }

          if (status == PagingStatus.ongoing) {
            _hasRequestedNextPage = false;
          }
        },

Which makes the Paged View request a new page when the current state is loading first page.
This makes sense if there is only a singular view, but will immediately lead to duplicate requests if the controller is connected to multiple views.
This would need to be handled inside the controller instead, but then we would loose loading data only when the screen is built.
In the end, I suppose, it would still make sense if the controller deduped requests.
(I would also still argue for passing a callback to the controller that returns a Future and having the controller tightly control that callback, instead of adding pagelisteners)

fun news, I found out that there are even more unrelated ways that the view can trigger duplicated requests.
I have absolutely no idea how it happens, but it can happen, very rarely.
Logs
-------------------------------------------------
[#2a6c2]
#0      RawDataController.loadPage (package:e1547/interface/data/controller.dart:137)
#1      PagingController.notifyPageRequestListeners.<anonymous closure> (package:infinite_scroll_pagination/src/core/paging_controller.dart:215)
#2      _GrowableList.forEach (dart:core-patch/growable_array.dart:433)
#3      PagingController.notifyPageRequestListeners (package:infinite_scroll_pagination/src/core/paging_controller.dart:213)
#4      _PagedLayoutBuilderState.build.<anonymous closure> (package:infinite_scroll_pagination/src/widgets/helpers/paged_layout_builder.dart:164)
#5      _ListenableListenerState._handleChange (package:infinite_scroll_pagination/src/utils/listenable_listener.dart:53)
#6      _ListenableListenerState.initState (package:infinite_scroll_pagination/src/utils/listenable_listener.dart:34)
#7      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4893)
#8      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729)
-------------------------------------------------
[#2a6c2] loadpage with 1
[#2a6c2] acquired mutex on page 1
[#2a6c2] done with loading page 1
-------------------------------------------------
[#572ad]
#0      RawDataController.loadPage (package:e1547/interface/data/controller.dart:137)
#1      PagingController.notifyPageRequestListeners.<anonymous closure> (package:infinite_scroll_pagination/src/core/paging_controller.dart:215)
#2      _GrowableList.forEach (dart:core-patch/growable_array.dart:433)
#3      PagingController.notifyPageRequestListeners (package:infinite_scroll_pagination/src/core/paging_controller.dart:213)
#4      _PagedLayoutBuilderState._buildListItemWidget.<anonymous closure> (package:infinite_scroll_pagination/src/widgets/helpers/paged_layout_builder.dart:276)
#5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
#6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1089)
#7      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995)
#8      _rootRun (dart:async/zone.dart:1426)
-------------------------------------------------
[#572ad] loadpage with 2
[#572ad] acquired mutex on page 2
-------------------------------------------------
[#79f71]
#0      RawDataController.loadPage (package:e1547/interface/data/controller.dart:137)
#1      PagingController.notifyPageRequestListeners.<anonymous closure> (package:infinite_scroll_pagination/src/core/paging_controller.dart:215)
#2      _GrowableList.forEach (dart:core-patch/growable_array.dart:433)
#3      PagingController.notifyPageRequestListeners (package:infinite_scroll_pagination/src/core/paging_controller.dart:213)
#4      _PagedLayoutBuilderState._buildListItemWidget.<anonymous closure> (package:infinite_scroll_pagination/src/widgets/helpers/paged_layout_builder.dart:276)
#5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
#6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1089)
#7      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995)
#8      _rootRun (dart:async/zone.dart:1426)
-------------------------------------------------
[#79f71] loadpage with 2
-------------------------------------------------
[#133c6]
#0      RawDataController.loadPage (package:e1547/interface/data/controller.dart:137)
#1      PagingController.notifyPageRequestListeners.<anonymous closure> (package:infinite_scroll_pagination/src/core/paging_controller.dart:215)
#2      _GrowableList.forEach (dart:core-patch/growable_array.dart:433)
#3      PagingController.notifyPageRequestListeners (package:infinite_scroll_pagination/src/core/paging_controller.dart:213)
#4      _PagedLayoutBuilderState._buildListItemWidget.<anonymous closure> (package:infinite_scroll_pagination/src/widgets/helpers/paged_layout_builder.dart:276)
#5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
#6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1089)
#7      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995)
#8      _rootRun (dart:async/zone.dart:1426)
-------------------------------------------------
[#133c6] loadpage with 2
[#572ad] done with loading page 2
[#79f71] acquired mutex on page 2
[#79f71] done with loading page 2
[#133c6] acquired mutex on page 2
[#133c6] done with loading page 2
-------------------------------------------------
[#ce439]
#0      RawDataController.loadPage (package:e1547/interface/data/controller.dart:137)
#1      PagingController.notifyPageRequestListeners.<anonymous closure> (package:infinite_scroll_pagination/src/core/paging_controller.dart:215)
#2      _GrowableList.forEach (dart:core-patch/growable_array.dart:433)
#3      PagingController.notifyPageRequestListeners (package:infinite_scroll_pagination/src/core/paging_controller.dart:213)
#4      _PagedLayoutBuilderState._buildListItemWidget.<anonymous closure> (package:infinite_scroll_pagination/src/widgets/helpers/paged_layout_builder.dart:276)
#5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
#6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1089)
#7      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995)
#8      _rootRun (dart:async/zone.dart:1426)
-------------------------------------------------
[#ce439] loadpage with 3
[#ce439] acquired mutex on page 3
[#ce439] done with loading page 3

as you can see, the PagedLayout triggered a request for page 2 three times in a row.
personally I have encountered this issue only 2 times and a user of mine has encountered it once.
There is nothing I can do in my own class that expands the PagingController to prevent this.
Mutexes can prevent having multiple requests run at once, but the PagedLayout can request the same key in quick succession.
Technically, I could keep track of which keys were requested already, or which key is being requested at this very moment, but I would like to stop trying to work around and on top of the package.

I have same issues. Im surprised there is really few peoples come here.

I am also seeing the same issue. I have a search bar, and a grid view with results. For the first search action, I see only single call being made by the listener.
But on trying a new search ->
I call
pagingController.refresh();
pagingController.notifyPageRequestListeners(0);

And thats when I see 2 requests being made with the same query..

@ahetawal-p that's because you aren't supposed to notify the page request listeners after calling refresh, it already does that itself.

Thanks @clragon do you mean, after calling pagingController.refresh(); I can expect the pagingController to make a new call to the api for the new search query ?

I see duplicates whenever I implement this in a search bar

here's a fun workaround:
if you generate all your models with freezed,
they will now be equal if their fields are equal.
you now just have to toSet().toList() on all your data everytime you add any,
and you will never see duplicates.
This is a terrible solution.

@clragon hey, I've been facing the same issue, I think there are a lot of ways to go about this. The simplest might be to set a variable to track the last refreshed key and ignore the reload if that key is passed in again?
initialize
 int lastRefreshedPage = -1;
  final PagingController<int, widget>
      controller = PagingController(firstPageKey: 0);

refresh call
                             onRefresh: () async {
                                controller.lastRefreshedPage = -1;
                                controller.controller
                                    .refresh();
                                if (kDebugMode) {
                                  print('finished refreshing');
                                }
                              },

mutex call
  @override
  void onInit() {
    super.onInit();
    controller.addPageRequestListener((pageKey) async {
      if (!await canRefresh()) {
        return;
      }
      await paginatedFunction(pageKey);
    });
  }

  // locking function
  Future<bool> canRefresh() async {
    if (_requestLock.isLocked) {
      if (_isRefreshing) {
        return false;
      }
      // waits to acquire lock
      await _requestLock.acquire();
      if (kDebugMode) {
        print('releasing lock');
      }
      return true;
    } else {
      return true;
    }
  }

Function call
  Future paginatedFunction(int after) async {
    // we've seen the requested key before, just skip
    if (lastRefreshedPage == after) {
      print('I saw this key before $after skipping call');
      return;
    }
....
logic

@clragon hey, I've been facing the same issue, I think there are a lot of ways to go about this. The simplest might be to set a variable to track the last refreshed key and ignore the reload if that key is passed in again?
initialize
 int lastRefreshedPage = -1;
  final PagingController<int, widget>
      controller = PagingController(firstPageKey: 0);

refresh call
                             onRefresh: () async {
                                controller.lastRefreshedPage = -1;
                                controller.controller
                                    .refresh();
                                if (kDebugMode) {
                                  print('finished refreshing');
                                }
                              },

mutex call
  @override
  void onInit() {
    super.onInit();
    controller.addPageRequestListener((pageKey) async {
      if (!await canRefresh()) {
        return;
      }
      await paginatedFunction(pageKey);
    });
  }

  // locking function
  Future<bool> canRefresh() async {
    if (_requestLock.isLocked) {
      if (_isRefreshing) {
        return false;
      }
      // waits to acquire lock
      await _requestLock.acquire();
      if (kDebugMode) {
        print('releasing lock');
      }
      return true;
    } else {
      return true;
    }
  }

Function call
  Future paginatedFunction(int after) async {
    // we've seen the requested key before, just skip
    if (lastRefreshedPage == after) {
      print('I saw this key before $after skipping call');
      return;
    }
....
logic

So this seems to not work in production for some reason

Any update on this?

So I was able to fix this in my case using AutomaticKeepAliveClientMixin
@override
  void initState() {
    widget.moduleController.pagingController
        .addPageRequestListener(_requestListener);
    super.initState();
  }

The initState was duplicatind the request listeners.

@FarhanSajid1 thats because you copied code from my repo without understanding it.
You somehow removed the part where I unlock the mutex again after waiting for it.
All of that code is old now and I use something different.
I have a very complicated mutex object that keeps track of what pages have been requested by the controller, plus my custom controller which keeps a tight grip on all requests and also knows what function is used to get new data. basically I have moved all functionality into the controller instead of it coming from outside. But I believe my additions might be too complicated.
This issue could easier be solved if the controller was structured a bit more like a Bloc, where there is a stream of page requests and the stream is consumed one by one, each request can then be a request for a page, or it can be a request for a reset of the controller, etc. That way, the state of the controller is clearly managed and the duplicate page problem could be counteracted.
But I havent come up with a clear idea of how that would look like.

same issue,
I using Getx, I have bottom navigation and a Navigator widget nested with 2 page.
each page have one view (PagedListView).
the issue appear when switching 2 page, the listener called multiple times (duplicate) with undesirable pageKey.
the listener calls still increase when switch the pages again.
when working on one page (without switching page), works perfectly.
I think the issue relate with this package.
I can't figure out what's wrong more, any help?

I have similar problem using getx..even though last page is reached, fetchPage() is called more than once sometimes (on route init).

This is my controler
 class ContractsController extends GetxController {
  int limit = 30;
  final PagingController<int, SubscriberContract> pagingController =
      PagingController(firstPageKey: 1);

  @override
  void onInit() {
    pagingController.addPageRequestListener((pageKey) {
      _getContractsActive(page: pageKey, limit: limit);
    });
    super.onInit();
  }

  @override
  void onClose() {
    pagingController.dispose();
    super.onClose();
  }

  Future<void> _getContractsActive(
      {required int page, required int limit}) async {
    '_getContractsActive ran -  page: $page'.printInfo();
    final contractsOrFailure = await ApiRepository.to.getSubscriberContracts(
        situation: ContractSituation.active, page: page, limit: limit);
    contractsOrFailure.fold((l) {
      pagingController.error = l.message;
    }, (r) {
      final isLastPage = r.length < limit;
      if (isLastPage) {
        'last page reached'.printInfo();
        pagingController.appendLastPage(r);
      } else {
        final nextPageKey = page + 1;
        nextPageKey.printInfo();
        pagingController.appendPage(r, nextPageKey);
      }
    });
  }
}

My page is not nested nor is called from different views, I really would appreciate some analysis as I could not find out what is making the fetch being called sometimes once, sometimes 3 times on route initialization.
On bellow logs we can see that controller is initialized (where listener is added), _getContractsActive() is called 3 times, also the condition to append last page (making last page being added 3 times and presenting duplicated items on view) :
[GETX] GOING TO ROUTE /home/contratos
[GETX] Instance "ContractsController" has been created
[GETX] Info: String init...
[GETX] Instance "ContractsController" has been initialized
3 [GETX] Info: String _getContractsActive ran -  page: 1
2 [GETX] Info: String last page reached
[GETX] Info: String last page reached

My workaround was creating a variable to control function execution (very ugly):
final initialLoadingCalled = false.obs;
Future<void> _getContractsActive(
      {required int page, required int limit}) async {

   (...)

    if (page == 1) {
      if (initialLoadingCalled.value == true) {
        return;
      } else {
        initialLoadingCalled(true);
      }
    }

   (...)

  }

I even created a minimal sample using getx and this package, strange enough, it works ok on the sample.

I'm using only one view and one controller but I also face this issue.
In my case, the build method of my page was called twice. Looks like this is expected Flutter behaviour.

So there's no update on an issue that still persists after nearly 3 years?

@karimSalahx You've got a mixup in your method, I've corrected it:
bool _listIntersects<T>(
    PagingController<int, T> pagingController,
    List<T> data,
  ) {
    if (pagingController.itemList != null) {
      bool isIntersect = false;
      data.forEach(
        (item) {
          if ((pagingController.itemList!.contains(item))) isIntersect = true;
        },
      );
      return isIntersect;
    }
    return false;
  }


[HOPS-1565] Fixed Mover to work with single datanodes setups need for…

… HopsEE
Make sure there is no duplicate PR for this issue

Please check if the PR fulfills these requirements

[ ] Tests for the changes have been added and passed (for bug fixes / features)
[ ] HOPS JIRA issue has been opened for this PR
[x] All commits have been squashed down to a single commit
[x] The commit message has the following format: [HOPS-XXX] message

Post a link to the associated JIRA issue
https://hopshadoop.atlassian.net/browse/HOPS-1565

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

Can one of the admins verify this patch?

Jenkins test this please.

Jenkins test this please.

Several balancer tests are failing: https://jenkins.hops.works/view/pull/job/hops-pull/463/testReport/

Several balancer tests are failing: https://jenkins.hops.works/view/pull/job/hops-pull/463/testReport/

they pass now.

Jenkins test this please.

Jenkins test this please.

Jenkins test this please.

Jenkins test this please.

There is still some balancer test failing.


Issue #149 Document configuration

This PR primarily documents configuring the virtual machine, as that procedure requires more steps than general configuration (which is simply crc config set <property>).
The documentation for configuration in general is intentionally non-specific. We guide the reader as to how to view the current configuration and modify it, but do not list the configurable properties. These can be discovered via crc config --help, and not listing them explicitly removes a potential maintenance concern.
Configuration of preflight checks for the crc start command are also briefly mentioned.

@stoobie you add comments, but you do not request for changes?

@stoobie you add comments, but you do not request for changes?

@gbraad Sorry, I'm a noob with Github. I intend that you take my comments and suggestions seriously. Consider them as change requests.
How should I add change requests?

@stoobie That is why I wanted to confirm this, as it already got approved by an engineer.

Choose "Request changes" and confirm with "Submit review". Be sure to add a comment in the field, else it will refuse to submit.

@stoobie I've updated the PR to address your change requests. Do you mind re-reviewing the changes made?

@stoobie That is why I wanted to confirm this, as it already got approved by an engineer.

Choose "Request changes" and confirm with "Submit review". Be sure to add a comment in the field, else it will refuse to submit.

Thank you for that explanation! I was wondering what the difference was between just adding comments and using the Review Changes button.

For @stoobie

@gbraad I'm sorry but I don't understand if something is being requested of me in this comment.

@stoobie I've updated the PR to address your change requests. Do you mind re-reviewing the changes made?

@robin-owen I added my comments. Again, I apologize for my inexperience with Github, but if there's something I need to do at this point so that you can merge this, please tell me clearly, like @gbraad did when telling me how to review changes.

I marked the PR as "Request changes" to make sure this does not get merged; and as mentioned before a comment is needed; hence the "for @stoobie" as a follow-up to indicate why i do this. seems this got lost ... my excuse.


ci: Add nightly builds

Add nightly builds if the default branch (/dev/2.0) has changed since the last 24 hours.
Closes #78

First try never works 🥲 https://github.com/Iltotore/iron/actions/runs/3666687326

First try never works 🥲 Iltotore/iron/actions/runs/3666687326

Just saw it today. Re-launching the action does not solve the problem (hope lives on) and I am afraid that the problem could come from the count of artfacts released. I will investigate that this week.

Should be fixed now. We'll see the next push to dev/2.0


[kafka] Add encryption option for message sent through kafka

to: @xinyaohu
As Kafka is lack of ACL for the time being, sensitive information is not able to be sent through Kafka in plain text. This pr address this issue by adding an option to encrypt plog payload before sent through Kafka. The config file section looks like:
"encryption" : {
  "key" : "XXXX",
  "algorithm" : "AES",
  "transformation" : "AES/CBC/PKCS5Padding",
  "provider" : "SunJCE"
}

Test
This PR has been end-to-end tested on staging and production environment.

I want to know the following information before pushing this to prod. What is the impact on both CPU and memory usage? Can you do a simple benchmark to see

reading 10m sql to SQLCanonicalizer, and parse those to Canonicalizer Form
in addition to 1), apply compression on it.

I would like to see the timing on 1) and 2) to determine how much slower did we make plog on prod.

@xinyaohu thanks for the review.
The points you made are reasonable and I will work on that.

@xinyaohu: I've made corresponding fixes based on your review, and conducted a performance benchmark. For 3m queries, without encryption, it took 240s to do canonicalization along. With  "AES/CBC/PKCS5Padding" encryption, under a similar cpu and memory usage, encryption adds another 105s on top of it. In summary, my take away is that encryption is not significantly costly comparing to canonicalization.

@alexism @nelgau

looks good to me, let us a while to see if others have comment

Why put that in the Kafka handler and not in a separate handler?

Could we integrate BouncyCastle instead? https://www.bouncycastle.org/
I've had good experiences with it. Dealing with JCE policies is somewhat annoying.

I made it in kafka handler because 1) kafka is the place where we worry about leak of sensitive information as no ACL exists for kafka right now, and 2) we don't want to have encrypted message along the entire pipeline but instead only in kafka.
We can definitely iterate over to more elegant encryption implementation once we have the basics there.


SecurityError: localStorage is not available for opaque origins

Hi I am working detox test using Jest and I am getting the below issue recently . My RN version is 0.55.4 and using detox version 8.1.1 but the same tried with detox 8.0.0 version also and getting same issue. I am not sure this is a detox issue or not but if anyone have encountered such issue please let me know how to resolve this . Thanks
configuration="ios.sim.debug" loglevel="verbose" artifactsLocation="artifacts/ios.sim.debug.2018-07-27 11-20-59Z" node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$'
FAIL  e2e/firstTest.spec.js
● Test suite failed to run
SecurityError: localStorage is not available for opaque origins

  at Window.get localStorage [as localStorage] (../node_modules/jsdom/lib/jsdom/browser/Window.js:257:15)
      at Array.forEach (<anonymous>)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.888s
Ran all test suites matching /e2e/i with tests matching "^((?!:android:).)*$".
child_process.js:644
throw err;
^
Error: Command failed: node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$'
at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at runJest (/Users/yogesh/appname/node_modules/detox/local-cli/detox-test.js:150:6)
at run (/Users/yogesh/appname/node_modules/detox/local-cli/detox-test.js:83:7)
at Object. (/Users/yogesh/appname/node_modules/detox/local-cli/detox-test.js:213:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

What is the usecase of using jsdom with Detox ? I'm pretty sure this error is not related to Detox.

Seems like this error also fails our unit test suite. Some dependency published a broken version (is it jsdom?)

Hi all got the reason this due to new version of jest
On Fri 27 Jul, 2018, 18:07 Rotem Mizrachi-Meidan<EMAIL_ADDRESS>wrote:

Seems like this error also fails our unit test suite. Some dependency
published a broken version (is it jsdom?)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/wix/detox/issues/863#issuecomment-408406318, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AX8BltEESRGmTjBMHpsiPiredjy22MPXks5uKwl-gaJpZM4VjV56
.

Can you add more details? Which version is broken?

https://github.com/jsdom/jsdom/issues/2304

Fix your config according to jsdom/jsdom#2304.
Use "testEnvironment": "node"
https://github.com/wix/detox/commit/3aaa79ddac8530bd2f9e82009e384aae202dd3b5

I added both
"testURL": "http://localhost/",
"testEnvironment": "node"
jest configuration in package.json and am still getting the error

@XaviSmith examine the examples. You're adding it to the wrong place.
Where do you see jest configs in a package.json? There are no configs there.
https://github.com/wix/detox/blob/master/examples/demo-react-native-jest/package.json
Instead, you usually have e2e folder with config.json for Jest:
https://github.com/wix/detox/blob/master/examples/demo-react-native-jest/e2e/config.json
There you add it.

It was happened with Jest ^23 version
On Fri 27 Jul, 2018, 18:48 Rotem Mizrachi-Meidan<EMAIL_ADDRESS>wrote:

Can you add more details? Which version is broken?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/wix/detox/issues/863#issuecomment-408415840, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AX8BlnmNkbVlLAw_RnsWBGIu4EaHN0aCks5uKxM4gaJpZM4VjV56
.


Problem with visualisation

python -m metadrive.examples.drive_in_single_agent_env
produces
Successfully registered the following environments: ['MetaDrive-validation-v0', 'MetaDrive-10env-v0', 'MetaDrive-100envs-v0', 'MetaDrive-1000envs-v0', 'SafeMetaDrive-validation-v0', 'SafeMetaDrive-10env-v0', 'SafeMetaDrive-100envs-v0', 'SafeMetaDrive-1000envs-v0', 'MARLTollgate-v0', 'MARLBottleneck-v0', 'MARLRoundabout-v0', 'MARLIntersection-v0', 'MARLParkingLot-v0', 'MARLMetaDrive-v0'].
Known pipe types:
  CocoaGraphicsPipe
(all display modules loaded.)
:display:cocoadisplay(error): Could not find a usable pixel format.
:ShowBase(warning): Unable to open 'onscreen' window.

Device: MacOS 13.1 M1 arm64 (macOS-13.1-arm64-arm-64bit)
Python: 3.9.15

According to this issue, maybe you can update panda to 1.10.12 and use the Pygame renderer for using MetaDrive on MAC with new chips.
As @pengzhenghao has more experience with MAC+MetaDrive, I will also call for his help.
@pengzhenghao Could you help with this MAC problem?

Thanks for the reply @QuanyiLi !
@pengzhenghao , could you please help me how to use the Pygame renderer ?

Mac is not supported yet for the Panda3d native renderer. You can simply using Pygame renderer instead!

By changing the script with the above modifications, you can see a pop up window showing the pygame renderer. Note that python -m metadrive.examples.drive_in_single_agent_env  this script is used for demo so you might see that the cars are not moving.
In short, it is very easy to use pygame renderer, just add one line to your code: env.render("topdown")

@pengzhenghao thanks! It works perfectly!
Also setting manual_control to True makes the car moving too!

Great!


fix(discovery): restart istgt on 4 continuous send target requests

fixes https://www.github.com/openebs/openebs/issues/2382
After successful discovery, login request will be received by target.
On continuous 4 discovery failures, high mem usage at kubelet is observed due to this issue https://github.com/open-iscsi/open-iscsi/issues/155.
This PR is to restart istgt to avoid mem consumption at kubelet.
Signed-off-by: Vishnu Itta<EMAIL_ADDRESS>

This workaround is not required anymore. Issue is fixed with PR#231. Hence, closing this.


proxy: Fix ConditionallyUpgradeServerToTls not being notified

#1203 introduced a bug in the implementation of Future for
connection::ConditionallyUpgradeServerToTls. If the attempt to match
the current peek buffer was incomplete, the Future implementation
would return Ok(Async::NotReady). This results in the task yielding.
However, in this case the task would not be notified again, as the
NotReady state wasn't from an underlying IO resource. Instead, the
would never be ready.
This branch fixes this issue by simply continuing the loop, so that
we instead try to read more bytes from the socket and try to match
again, until the match is successful or the socket returns NotReady.
Signed-off-by: Eliza Weisman<EMAIL_ADDRESS>

(Sorry I didn't catch this one in code review)


Fixes 'NameError: uninitialized constant Guard::Guard::Compat'.

In a side project, using the following gem versions:
.gemspec:
...
# development dependencies.
gem.add_development_dependency('rspec', '~> 3.4.0')
gem.add_development_dependency('simplecov', '~> 0.7.0')
gem.add_development_dependency('guard', '~> 2.8.0')
gem.add_development_dependency('guard-rspec', '~> 4.6.4')
gem.add_development_dependency('rubocop', '~> 0.35.1')
gem.add_development_dependency('guard-rubocop', '~> 1.2.0')
gem.add_development_dependency('metric_fu', '~> 4.2.0')
gem.add_development_dependency('guard-reek', '~> 0.0.4')
gem.add_development_dependency('rake', '~> 10.4.2')
gem.add_development_dependency('yard', '~> 0.8.7')
gem.add_development_dependency('redcarpet', '~> 2.3.0')

Guardfile:
# vim: ft=ruby
# More info at https://github.com/guard/guard#readme
#
# More info also at https://github.com/guard/guard-rspec -- this one in
# particular details configuration options such as whether to run all tests
# after a failing test starts passing

guard :rspec, cmd: 'bundle exec rspec', cli: '--tag ~slow' do
  watch(%r{^spec/.+_spec\.rb})
  watch(%r{/^lib/(.+)\.rb$}) do |match|
    %w(unit integration acceptance).map do |kind|
      "spec/#{kind}/lib/#{match[1]}_spec.rb"
    end
  end
  watch('spec/spec_helper.rb')  { 'spec' }
  watch(%r{^spec/(fixtures|resources)(/|.rb)}) { 'spec' }
end

guard :rubocop, all_on_start: false do
  watch('Guardfile')
  watch(%r{/.+\.rb$})
  watch(%r{(?:.+\/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end

guard :reek do
  watch(%r{^lib/(.+)\.rb$})
end

Running bundle exec guard --debug
04:28:10 - INFO - Guard is using TerminalTitle to send notifications.
04:28:10 - DEBUG - Command execution: hash stty
04:28:10 - DEBUG - Guard starts all plugins
04:28:10 - DEBUG - Hook :start_begin executed for Guard::RSpec
04:28:10 - ERROR - Guard::RSpec failed to achieve its <start>, exception was:
> [#BCDB8011A582] NameError: uninitialized constant Guard::Guard::Compat
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:28:in `start'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:77:in `block in _supervise'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:74:in `catch'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:74:in `_supervise'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:20:in `block (2 levels) in run'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:135:in `block (3 levels) in _scoped_plugins'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:133:in `each'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:133:in `block (2 levels) in _scoped_plugins'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:132:in `catch'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:132:in `block in _scoped_plugins'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:129:in `each'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:129:in `_scoped_plugins'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:19:in `block in run'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack.rb:32:in `unit_of_work'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/runner.rb:18:in `run'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/commander.rb:25:in `start'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/cli.rb:113:in `start'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/aruba_adapter.rb:32:in `execute'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.8.2/bin/guard:11:in `<top (required)>'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/bin/guard:23:in `load'
> [#BCDB8011A582] /Users/benson.fung/.rbenv/versions/2.2.2/bin/guard:23:in `<main>'
04:28:10 - INFO - Guard::RSpec has just been fired

In commit b76a839, only lib/guard/rspec.rb used
Guard::Compat::UI

while other files such as lib/guard/rspec/deprecator.rb and lib/guard/rspec/runner.rb used
Compat::UI

Changed lib/guard/rspec.rb to use same syntax.  Unsure about lib/guard/rspec/notifier.rb.
Also fixes rubocop violations, as running tests did not pass locally:
bundle exec rake test:all_versions
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.0.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Inspecting 38 files
.C...........C................C....C..

Offenses:

guard-rspec.gemspec:13:5: C: Align the operands of an expression in an assignment spanning multiple lines.
    " (much like autotest)."
    ^^^^^^^^^^^^^^^^^^^^^^^^
lib/guard/rspec/options.rb:8:32: C: Unnecessary spacing detected.
        failed_mode:     :none,  # :keep and :focus are other posibilities
                               ^
spec/lib/guard/rspec/notifier_spec.rb:9:27: C: Optional arguments should appear at the end of the argument list.
  def expect_notification(title = "RSpec results", message, image, priority)
                          ^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/guard/rspec_formatter_spec.rb:53:9: C: Do not use parallel assignment.
        old, ENV[env_var] = ENV[env_var], "foobar.txt"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

38 files inspected, 4 offenses detected

I'm unsure of how to test the change in lib/guard/rspec.rb, since the test before passes even though it does not run properly - it seems like it's running in a different context of sorts.
Running rspec and rubocop locally after modification:
benson.fung:~/workspace/benson-fung/guard-rspec [git: fix_uninitialized_constant_Guard_Guard_Compat] $ bundle exec rake
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 26842
.............................................................................................................................no spec file location in {:location=>"failed_location_spec.rb"}
no spec file location in {:location=>"failed_location_spec.rb"}
.no spec file location in {:location=>"failed_location_spec.rb"}
.no spec file location in {:location=>"failed_location_spec.rb"}
.....................

Finished in 0.24322 seconds (files took 0.15314 seconds to load)
148 examples, 0 failures

Randomized with seed 26842

warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.0.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Running RuboCop...
Inspecting 38 files
......................................

38 files inspected, no offenses detected

And in my original project (modified the gem file locally to test), it works:
> bundle exec guard --debug
...
04:38:07 - INFO - Guard is using TerminalTitle to send notifications.
04:38:07 - DEBUG - Command execution: hash stty
04:38:07 - DEBUG - Guard starts all plugins
04:38:07 - DEBUG - Hook :start_begin executed for Guard::RSpec
Guard::RSpec is running
04:38:07 - DEBUG - Hook :start_end executed for Guard::RSpec

Thanks for the fix and all the details!
Just a few points:

Keep the method arguments order and initialize the default argument value later, e.g.

def expect_notification(title, message, image, priority)
  title ||= "RSpec results"

If you can, use separate commits for the fix vs the offenses. This helps with reviewing a lot.

Usually offenses in places other than your changes are not a big deal (but thanks for fixing them!). RuboCop gets updated often, so it's not always a good idea to immediately fix every new offense in the whole project. (But it's ok here, since there aren't many pull requests).

I'd suggest putting development dependencies in a Gemfile, even if you're already using a Gemfile with  gemspec. In my personal opinion, putting development dependencies in a .gemspec file is philosophically and technically wrong.

Thanks again and let me know if you have questions.

def expect_notification(title, message, image, priority)
  title ||= "RSpec results"

Won't actually work, since some methods only call 3 arguments, assuming that title will have a default value.  The resulting error will be:
ArgumentError:
       wrong number of arguments (3 for 4)
     # ./spec/lib/guard/rspec/notifier_spec.rb:9:in `expect_notification'
     # ./spec/lib/guard/rspec/notifier_spec.rb:17:in `block (3 levels) in <top (required)>'

I can add another method with 3 arguments that calls the 4 argument method with the default value, but that seems less Ruby-like (that's what I usually do in Java).  Let me know what you think on this one.

Yes, sorry about that. You can use nil in the arguments to make 3 arguments 4, e.g.
  expect_notification(nil, "Failed", :failed, 2)

The specs could probably be better, but this would be enough, because:

less changes means reviewing is easier
it's just specs, so readability is better (and the order with the "title first" is more intuitive, so reading the examples is easier)

Can I convince you that

The changes in this PR is already the minimal amount of changes needed to fix the the bug and also get the code in a build-able state (by passing tests and other code linters).  While I know that rubocop errors are a pain in the butt, if they're not abided by until release time, it just means more rework and code instability until a real release is made.  I do understand the want for separation of concerns on each code commit - Ideally, every commit would pass rubocop and other code linters so it wouldn't be necessary to have "fix code style" commits.
That passing in nil as a parameter value when all the code is under ones control is code smell - why have that parameter in the first place if the value being passed in is nothing / invalid!

less changes means reviewing is easier

As the PR already stands, it only changes 3 lines in spec/lib/guard/rspec/notifier_spec.rb.  By passing in nil as an argument, there would need to be changes on lines 32, 40, 49, and 57 - almost twice the number of changes.  If that's less happy, I can suggest changing line 11:
with(message, title: title, image: image, priority: priority)

into
with(message, image: image, priority: priority, title: title)

and the comprehension of all the code stays pretty much the same with minimal changes.

It's fine, thanks.
In the future, it's best to separate linter related changes from logic/method changes. Releases are based on merged branches, not commits, so it's ok to separate changes in multiple commits even if everything passes only for the last commit.
The nil wouldn't be bad in this case, because the method is to just make the tests more readable. The implicit default value actually makes the tests less obvious.
But that's ok, since this is a short test anyway.
The project is in maintenance mode mostly, so the biggest priority is not breaking things and making each commit clear. Sometimes it's good to be able to revert just the bugfix - without also reverting other changes. This normal makes merging easier, especially with other changes/PRs, etc.
But again, it doesn't really matter here - because the issue is easy to understand.


Add prominent link to GitHub repo and org

As a guest of adr.github.io I want to know where the GitHub repository is so I can file a bug or PR.
😉

Good catch, thanks


Fix for 18506665

18506665: Documentation: One-click install of IoT DM & DPS clients from WDP

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

windows-iotcore/manage-your-device/DevicePortal.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

windows-iotcore/manage-your-device/DevicePortal.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


String number parsing functions

str:parse_int
str:parse_float

This should be closed, right? https://github.com/lpil/gleam/blob/master/gleam_stdlib/src/str.gleam#L39-L41

Yup! Thank you


update logos submodule id

Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
#1114
Downgrade coincbc to 2.10.5, there is an issue with the latest version of coincbc that causes the failure of LOGOS plugin
What are the significant changes in functionality due to this change request?

For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.

[x] 1. Review all computer code.
[x] 2. If any changes occur to the input syntax, there must be an accompanying change to the user manual and xsd schema. If the input syntax change deprecates existing input files, a conversion script needs to be added (see Conversion Scripts).
[x] 3. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the wiki for details.
[x] 4. Automated Tests should pass, including run_tests, pylint, manual building and xsd tests. If there are changes to Simulation.py or JobHandler.py the qsub tests must pass.
[x] 5. If significant functionality is added, there must  be tests added to check this. Tests should cover all possible options.  Multiple short tests are preferred over one large test. If new development on the internal JobHandler parallel system is performed, a cluster test must be added setting, in  XML block, the node <internalParallel> to True.
[x] 6. If the change modifies or adds a requirement or a requirement based test case, the Change Control Board's Chair or designee also needs to approve the change.  The requirements and the requirements test shall be in sync.
[x] 7. The merge request must reference an issue.  If the issue is closed, the issue close checklist shall be done.
[x] 8. If an analytic test is changed/added is the the analytic documentation updated/added?
[x] 9. If any test used as a basis for documentation examples (currently found in raven/tests/framework/user_guide and raven/docs/workshop) have been changed, the associated documentation must be reviewed and assured the text matches the example.

PR looks good on my end; test dashboard is green; merging


[Exercise 04] Int2Str error

Hi, although Ex04 is not accepting any submissions, I still want to know why when I submitted only the two java files DivisibleBy and LongerThan (before the deadline), this error occurred (despite normal testing in JShell).

Did you import Transformer?

You perhaps did not import Transformer

Likely did not import Transformer

Please import transformer

But at least in level 1 no Transformer is required right?

I don't think you imported transformer

@minhkiwi14 if it all worked, you might want to close this issue. Thanks!


Config permission denied error with rootless podman

Describe the bug
I'm trying to run OCIS with rootless podman on Fedora following the Container Setup guide. I've verified the logged in user has the default user and group ID 1000 matching the container user and group ID.
However, I'm getting a permission denied error when creating or accessing the config file /etc/ocis/ocis.yaml. When running podman as root no error is thrown.
Steps to reproduce

Verify the logged in user has the default user and group ID 1000 matching the container user and group ID.

> id
uid=1000(foobar) gid=1000(foobar) groups=1000(foobar),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
> podman inspect -f '{{.Config.User}}' owncloud/ocis
1000

Create the config and data folders and verify the user and group ID again.

> mkdir config data
> ls -n
total 4
drwxr-xr-x. 1 1000 1000  18 Jun 13 16:35 config
drwxr-xr-x. 1 1000 1000   0 Jun 13 14:54 data
-rw-r--r--. 1 1000 1000 396 Jun 13 16:06 docker-compose.yml

Run the First Time Initialization to create the config. This fails with the error.

> podman run -it -v ./config:/etc/ocis:Z owncloud/ocis:latest init
2024/06/13 14:31:58 INFO memory is not limited, skipping package=github.com/KimMachineGun/automemlimit/memlimit
Do you want to configure Infinite Scale with certificate checking disabled?
 This is not recommended for public instances! [yes | no = default]
2024/06/13 14:31:58 Could not create config: open /etc/ocis/ocis.yaml: permission denied

Run the command as sudo again. This creates the config successfully.

> sudo podman run -it -v ./config:/etc/ocis:Z owncloud/ocis:latest init
2024/06/13 14:43:01 INFO memory is not limited, skipping package=github.com/KimMachineGun/automemlimit/memlimit
Do you want to configure Infinite Scale with certificate checking disabled?
 This is not recommended for public instances! [yes | no = default]

=========================================
 generated OCIS Config
=========================================
 configpath : /etc/ocis/ocis.yaml
 user       : admin
 password   : <redacted>

Run the container. This fails with the error.

> podman compose up
>>>> Executing external compose provider "/usr/bin/podman-compose". Please refer to the documentation for details. <<<<

2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
[ocis] | 2024/06/13 14:35:23 INFO memory is not limited, skipping package=github.com/KimMachineGun/automemlimit/memlimit
[ocis] | open etc/ocis/ocis.yaml: permission denied
[ocis] | open etc/ocis/ocis.yaml: permission denied

Run the command as sudo again. This starts the container successfully.

> sudo podman compose up
>>>> Executing external compose provider "/usr/bin/podman-compose". Please refer to the documentation for details. <<<<

2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
[ocis] | 2024/06/13 14:45:55 INFO memory is not limited, skipping package=github.com/KimMachineGun/automemlimit/memlimit
[ocis] | {"level":"info","service":"nats","time":"2024-06-13T14:45:55Z","line":"github.com/owncloud/ocis/v2/services/nats/pkg/logging/nats.go:2
1","message":"Starting nats-server"}
<truncated>

Expected behavior
No permission denied error.
Actual behavior
Permission denied error.
Setup

docker-compose.yml

version: "3.7"

services:
  ocis:
    image: docker.io/owncloud/ocis:latest
    environment:
      - OCIS_INSECURE=true
      - OCIS_URL=https://<IP_ADDRESS>:9200
      - OCIS_LOG_LEVEL=info
    restart: unless-stopped
    volumes:
      - ./config:/etc/ocis:Z
      - ./data:/var/lib/ocis:Z
    ports:
      - "9200:9200"

(Note: the :Z is necessary with podman for a SELinux issue.^selinux)
Additional context

podman 5.0.3
Fedora 40
owncloud OCIS 5.1.0-prealpha+b6141627e

I don't think this is a problem with ocis. It's causes by the fact that rootless podman uses user namespacest. That means that the uidnumbers inside the container don't match the uids on the host system. You need to adjust the ownership of the directories to the mapped uids of the namespace. What I usually use  is podman unshare to enter the user namespace and adjust file ownership from there.
So in your case:
open a new terminal cd into the directory on the host containing the desired config and data directory and run:
> podman unshare

this basically makes you root in the user namespace then you can change the ownership of config directory. Now run:
# chown 1000 config
# chown 1000 data

then exit  the terminal session. On the host the directory should now have changed the ownership to the mapped userids of the namespace (on my system that is 1000999 e.g., might be different on yours).

That worked flawlessly. Thanks so much!


fix(chart): update default setting log level

https://github.com/longhorn/longhorn/issues/6257

Do we need to change this after fixing the PVC recurring job label issue?

Do we need to change this after fixing the PVC recurring job label issue?

We've updated the log level to "info" so the recurring job source label log at the "debug" level doesn't overwhelm when the cluster is at the default log level setting.
So this is to reflect on the log level change. Any concerns?

OK. Just noticed that the log level is changed to debug rather than trace.
As we discussed before, some of the important logs were level debug. Suppressing them would make the support bundle debugging more difficult.
Not sure we already tune all logs and it's fine to change the default level to debug now. cc @derekbit

Most of debug level logs are adjusted in https://github.com/longhorn/longhorn-manager/pull/2059 and previous commits.
The remaining ones are "requeue....", "...backoff" and so on.
cc @shuo-wu

@shuo-wu any concern here?

@mergify backport v1.5.x


pull request for e2e test at 01/11/2017 00:15:14

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Fix flickering MI report presenter spec

there  is a time related spec which may
occasionally flicker (see pic).

Looks good to me  - go ahead and merge (I don't have permissions to merge yet)


Fix/generate type files

change the typescript processor plugin on rollup to automatcally generates types files (as well as typescript compiler)

rm cache files, I guess


How to gate playback on Bluetooth Headset connection

I'd like to ensure playback is only active when a bluetooth headset is connected.
For stopping when the audio output changes it seems like .setHandleAudioBecomingNoisy(true) is the right approach.
Is LoadControl, the right API when the user clicks play to trigger a headset selection before continuing?
I've seen the references in https://github.com/google/ExoPlayer/issues/9694, so I understand I'll need to implement this myself, but am curious which APIs are the right ones to plug into, to effect availableCommands for example?  Or maybe allow the command, but launch the Bluetooth settings automatically and wait for a connection before playing?

I think this should be done outside of the player.  ExoPlayer's audio-becoming-noisy handling might be sufficient for stopping the audio, but it's probably cleaner and more symmetric if you also handle this outside of the player. In other words, listen for the headset disconnecting, and stopping the player when this occurs.
How to query bluetooth connected devices is outside the scope of this issue tracker, but you should be able to find what you need online. For example https://stackoverflow.com/questions/4715865/how-can-i-programmatically-tell-if-a-bluetooth-device-is-connected has some sample isBluetoothHeadsetConnected methods that might be useful to you.

@ojw28 Thanks.  That makes sense, and I've got docs on how to check and connect to the bluetooth headset.
It's not perfect, If the app laucnhes and then bluetooth disconnects before playback is started, I'll be in the same place.  I can guard any play button presses, but it doesn't help for commands via the MediaSession, so I was hoping there was a nice approach to do this in ExoPlayer/Media3.  Maybe show up via affecting availableCommands? Maybe interject during the LoadControl before it continues? I understand if not, and if there is some clean way to add, I'll suggest putting up a PR.
Would there be a downside to using LoadControl?

I don't think LoadControl is the right place to be doing this. It feels like it's too deep in the player.
If you'd like to push your logic for starting playback just inside of the player, so that it works for commands via the MediaSession (and any other UI component), then you could use ForwardingPlayer. This is completely untested, but I'd imagine it would looks something like:
private static final class BtPlayer extends ForwardingPlayer {

    public BtPlayer(ExoPlayer player) {
      super(player);
      player.setHandleAudioBecomingNoisy(true);
    }

    @Override
    public void prepare() {
      if (blockPlayback()) {
        return;
      }
      super.prepare();
    }

    @Override
    public void play() {
      if (blockPlayback()) {
        return;
      }
      super.play();
    }

    @Override
    public void setPlayWhenReady(boolean playWhenReady) {
      if (playWhenReady && blockPlayback()) {
        return;
      }
      super.setPlayWhenReady(playWhenReady);
    }

    private boolean blockPlayback() {
      // Return true if playback should not be allowed to start.
      return true;
    }
}

You can then wrap your ExoPlayer inside an instance of this class, and pass the BtPlayer to the media session and any other UI components.

Thanks I'll try that or fallback to external logic at all points before playing.
Thanks.

The above solution has worked reasonably well, but it looks like to avoid errors like https://github.com/androidx/media/issues/167.
We will need to implement https://github.com/google/horologist/issues/562 and use playback suppression for this.


added deb 11 and updated 10

Signed-off-by: rachejazz<EMAIL_ADDRESS>After this is merged, I will update the submodule and send PR for the main repo
It's a tedious to pull when the submodules are getting merged after the main repo gets

Also,
Fixes openmainframeproject/software-discovery-tool#67


Add social image functionality

Add meta data so that when sharing on a social site there is a specific image

This was a duplicate


[Feature]: Ability to rename a custom category

Describe the feature
After creation you should be able to rename the custom category.

Describe the implementation
Few options

Add a button next to delete that popups a modal to ask for a new name.
Replace the title inline with an editbox on double click

duplicate #145